aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-11-20 17:36:31 +0000
committerJeff Law <law@redhat.com>1996-11-20 17:36:31 +0000
commitf497f3ae7c8672d274d8af95811019cd826d38ca (patch)
tree70b4c6dd379c3bbd5fa5368174cc7f90cf9090a6
parent3817470b808827ec7b5520f51be41cc1527c6726 (diff)
downloadgdb-f497f3ae7c8672d274d8af95811019cd826d38ca.zip
gdb-f497f3ae7c8672d274d8af95811019cd826d38ca.tar.gz
gdb-f497f3ae7c8672d274d8af95811019cd826d38ca.tar.bz2
* mn10300-dis.c (print_insn_mn10300): Fix fetch of last byte
in 7 byte insns. (disassemble): Handle SPLIT and EXTENDED operands.
-rw-r--r--opcodes/ChangeLog6
-rw-r--r--opcodes/mn10300-dis.c25
2 files changed, 27 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index fd30222..f937a1a 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+Wed Nov 20 10:37:13 1996 Jeffrey A Law (law@cygnus.com)
+
+ * mn10300-dis.c (print_insn_mn10300): Fix fetch of last byte
+ in 7 byte insns.
+ (disassemble): Handle SPLIT and EXTENDED operands.
+
Tue Nov 19 13:33:01 1996 Jeffrey A Law (law@cygnus.com)
* mn10300-dis.c: Rough cut at printing some operands.
diff --git a/opcodes/mn10300-dis.c b/opcodes/mn10300-dis.c
index 6c1b4d2..4edd614 100644
--- a/opcodes/mn10300-dis.c
+++ b/opcodes/mn10300-dis.c
@@ -221,10 +221,10 @@ print_insn_mn10300 (memaddr, info)
}
extension = bfd_getb16 (buffer);
extension <<= 8;
- status = (*info->read_memory_func) (memaddr + 7, buffer, 1, info);
+ status = (*info->read_memory_func) (memaddr + 6, buffer, 1, info);
if (status != 0)
{
- (*info->memory_error_func) (status, memaddr + 7, info);
+ (*info->memory_error_func) (status, memaddr + 6, info);
return -1;
}
extension |= *(unsigned char *)buffer;
@@ -298,8 +298,25 @@ disassemble (memaddr, info, insn, extension, size)
operand = &mn10300_operands[*opindex_ptr];
- value = ((insn >> (operand->shift))
- & ((1 << operand->bits) - 1));
+ if ((operand->flags & MN10300_OPERAND_SPLIT) != 0)
+ {
+ unsigned long temp;
+ value = insn & ((1 << operand->bits) - 1);
+ value <<= (32 - operand->bits);
+ temp = extension >> operand->shift;
+ temp &= ((1 << 32 - operand->bits) - 1);
+ value |= temp;
+ }
+ else if ((operand->flags & MN10300_OPERAND_EXTENDED) != 0)
+ {
+ value = ((extension >> (operand->shift))
+ & ((1 << operand->bits) - 1));
+ }
+ else
+ {
+ value = ((insn >> (operand->shift))
+ & ((1 << operand->bits) - 1));
+ }
if ((operand->flags & MN10300_OPERAND_SIGNED) != 0)
value = ((long)(value << (32 - operand->bits))