Changeset 609 for branches/GNU/src/binutils/opcodes/m10300-dis.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/opcodes/m10300-dis.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Disassemble MN10300 instructions. 2 Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.2 Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 20 20 21 21 #include "sysdep.h" 22 #include "opcode/mn10300.h" 22 #include "opcode/mn10300.h" 23 23 #include "dis-asm.h" 24 24 #include "opintl.h" … … 30 30 #define HAVE_AM30 (info->mach == AM30) 31 31 32 int 32 int 33 33 print_insn_mn10300 (memaddr, info) 34 34 bfd_vma memaddr; … … 104 104 { 105 105 (*info->memory_error_func) (status, memaddr, info); 106 106 return -1; 107 107 } 108 108 insn = bfd_getb16 (buffer); … … 112 112 /* These are three byte insns. */ 113 113 else if ((insn & 0xff) == 0xf8 114 || (insn & 0xff) == 0xcc 114 || (insn & 0xff) == 0xcc 115 115 || (insn & 0xff) == 0xf9 116 116 || (insn & 0xf3) == 0x01 … … 141 141 return -1; 142 142 } 143 insn |= *(unsigned char *) buffer;143 insn |= *(unsigned char *) buffer; 144 144 consume = 3; 145 145 } … … 250 250 else 251 251 mysize = 7; 252 252 253 253 if ((op->mask & insn) == op->opcode 254 254 && size == (unsigned int) mysize … … 260 260 unsigned int nocomma; 261 261 int paren = 0; 262 262 263 263 if (op->format == FMT_D1 || op->format == FMT_S1) 264 264 extra_shift = 8; … … 364 364 return; 365 365 } 366 extension = *(unsigned char *) buffer;366 extension = *(unsigned char *) buffer; 367 367 } 368 368 else if (size == 6 && op->format == FMT_D8) … … 375 375 return; 376 376 } 377 insn |= *(unsigned char *) buffer;377 insn |= *(unsigned char *) buffer; 378 378 379 379 status = (*info->read_memory_func) (memaddr + 3, buffer, 2, info); … … 427 427 insn |= (temp >> 8) & 0xffffff; 428 428 extension = (temp & 0xff) << 16; 429 429 430 430 status = (*info->read_memory_func) (memaddr + 5, buffer, 2, info); 431 431 if (status != 0) … … 450 450 insn |= (temp >> 16) & 0xffff; 451 451 extension = (temp & 0xffff) << 8; 452 452 453 453 status = (*info->read_memory_func) (memaddr + 6, buffer, 1, info); 454 454 if (status != 0) … … 457 457 return; 458 458 } 459 extension |= *(unsigned char *) buffer;459 extension |= *(unsigned char *) buffer; 460 460 } 461 461 … … 485 485 temp &= ((1 << (32 - operand->bits)) - 1); 486 486 value |= temp; 487 value = ((value ^ (((unsigned long) 1) << 31))488 - (((unsigned long) 1) << 31));487 value = ((value ^ (((unsigned long) 1) << 31)) 488 - (((unsigned long) 1) << 31)); 489 489 } 490 490 else if ((operand->flags & MN10300_OPERAND_24BIT) != 0) … … 513 513 /* These are properly extended by the code above. */ 514 514 && ((operand->flags & MN10300_OPERAND_24BIT) == 0)) 515 value = ((value ^ (((unsigned long) 1) << (operand->bits - 1)))516 - (((unsigned long) 1) << (operand->bits - 1)));515 value = ((value ^ (((unsigned long) 1) << (operand->bits - 1))) 516 - (((unsigned long) 1) << (operand->bits - 1))); 517 517 518 518 if (!nocomma … … 522 522 523 523 nocomma = 0; 524 524 525 525 if ((operand->flags & MN10300_OPERAND_DREG) != 0) 526 526 { 527 527 value = ((insn >> (operand->shift + extra_shift)) 528 528 & ((1 << operand->bits) - 1)); 529 (*info->fprintf_func) (info->stream, "d%d", (int) value);529 (*info->fprintf_func) (info->stream, "d%d", (int) value); 530 530 } 531 531 … … 534 534 value = ((insn >> (operand->shift + extra_shift)) 535 535 & ((1 << operand->bits) - 1)); 536 (*info->fprintf_func) (info->stream, "a%d", (int) value);536 (*info->fprintf_func) (info->stream, "a%d", (int) value); 537 537 } 538 538 … … 551 551 & ((1 << operand->bits) - 1)); 552 552 if (value < 8) 553 (*info->fprintf_func) (info->stream, "r%d", (int) value);553 (*info->fprintf_func) (info->stream, "r%d", (int) value); 554 554 else if (value < 12) 555 (*info->fprintf_func) (info->stream, "a%d", (int) value - 8);555 (*info->fprintf_func) (info->stream, "a%d", (int) value - 8); 556 556 else 557 (*info->fprintf_func) (info->stream, "d%d", (int) value - 12);557 (*info->fprintf_func) (info->stream, "d%d", (int) value - 12); 558 558 } 559 559 … … 565 565 (*info->fprintf_func) (info->stream, "sp", value); 566 566 else 567 (*info->fprintf_func) (info->stream, "xr%d", (int)value);567 (*info->fprintf_func) (info->stream, "xr%d", (int) value); 568 568 } 569 569 … … 671 671 } 672 672 673 else 674 (*info->fprintf_func) (info->stream, "%ld", (long) value);673 else 674 (*info->fprintf_func) (info->stream, "%ld", (long) value); 675 675 } 676 676 /* All done. */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.