ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/mon/src/disass/m68k-dis.c
(Generate patch)

Comparing mon/src/disass/m68k-dis.c (file contents):
Revision 1.1 by cebix, 2000-09-25T12:44:38Z vs.
Revision 1.4 by gbeauche, 2003-04-13T09:54:26Z

# Line 16 | Line 16 | You should have received a copy of the G
16   along with this program; if not, write to the Free Software
17   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18  
19 + #include <stdlib.h>
20   #include "dis-asm.h"
21   #include "floatformat.h"
22   #include "opintl.h"
23  
24   #include "m68k.h"
25  
25 #include "../mon_atraps.h"
26
26   /* Local function prototypes */
27  
28   static int
# Line 201 | Line 200 | print_insn_m68k (memaddr, info)
200        /* Then create a sorted table of pointers that point into the
201           unsorted table.  */
202        opc_pointer[0] = ((const struct m68k_opcode **)
203 <                        xmalloc (sizeof (struct m68k_opcode *)
203 >                        malloc (sizeof (struct m68k_opcode *)
204                                   * m68k_numopcodes));
205        opcodes[0] = opc_pointer[0];
206        for (i = 1; i < 16; i++)
# Line 436 | Line 435 | print_insn_m68k (memaddr, info)
435    return p - buffer;
436  
437   invalid: {
438 <        unsigned long opcode = (buffer[0] << 8) | buffer[1];
440 <        const struct atrap_info *p = atraps;
438 >        extern void print_68k_invalid_opcode(unsigned long, struct disassemble_info *);
439  
440      /* Handle undefined instructions.  */
441      info->fprintf_func = save_printer;
442      info->print_address_func = save_print_address;
443 <
446 <        /* Look for MacOS A-Trap */
447 <        while (p->word) {
448 <                if (p->word == opcode) {
449 <                        (*info->fprintf_func) (info->stream, p->name);
450 <                        return 2;
451 <                }
452 <                p++;
453 <        }
454 <
455 <    (*info->fprintf_func) (info->stream, "?");
443 >        print_68k_invalid_opcode((buffer[0] << 8) | buffer[1], info);
444      return 2;
445    }
446   }
# Line 686 | Line 674 | print_insn_arg (d, buffer, p0, addr, inf
674        else
675          return -2;
676  
677 + #if 1
678 +      /* FIXME: We are bound to have 32-bit addresses even if cxmon is
679 +         requested to run in real mode, because m68k is 32-bit.  */
680 +      (*info->fprintf_func) (info->stream, "$%08x", (uint32)(addr + disp));
681 + #else
682        (*info->print_address_func) (addr + disp, info);
683 + #endif
684        break;
685  
686      case 'd':
# Line 786 | Line 780 | print_insn_arg (d, buffer, p0, addr, inf
780  
781              case 2:
782                val = NEXTWORD (p);
783 <              (*info->fprintf_func) (info->stream, "(");
790 <              (*info->print_address_func) (addr + val, info);
791 <              (*info->fprintf_func) (info->stream, ",pc)");
783 >              (*info->fprintf_func) (info->stream, "($%08x,pc)", addr + val);
784                break;
785  
786              case 3:
# Line 1243 | Line 1235 | print_base (regno, disp, info)
1235       bfd_vma disp;
1236       disassemble_info *info;
1237   {
1238 <  if (regno == -1)
1239 <    {
1240 <      (*info->print_address_func) (disp, info);
1241 <      (*info->fprintf_func) (info->stream, ",pc");
1242 <    }
1243 <  else
1244 <    {
1245 <      (*info->fprintf_func) (info->stream, "$%08x", disp);
1246 <      if (regno == -3)
1247 <        (*info->fprintf_func) (info->stream, ",zpc");
1256 <      else if (regno != -2)
1257 <        (*info->fprintf_func) (info->stream, ",%s", reg_names[regno]);
1258 <    }
1238 >        if (regno == -1)
1239 >                (*info->fprintf_func) (info->stream, "$%08x,pc", disp);
1240 >        else {
1241 >                if (regno == -3)
1242 >                        (*info->fprintf_func) (info->stream, "$%08x,zpc", disp);
1243 >                else if (regno == -2)
1244 >                        (*info->print_address_func) (disp, info);
1245 >                else
1246 >                        (*info->fprintf_func) (info->stream, "$%08x,%s", disp, reg_names[regno]);
1247 >        }
1248   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines