]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* mn10300-dis.c (print_insn_mn10300): Fix fetch of last byte
authorJeff Law <law@redhat.com>
Wed, 20 Nov 1996 17:36:31 +0000 (17:36 +0000)
committerJeff Law <law@redhat.com>
Wed, 20 Nov 1996 17:36:31 +0000 (17:36 +0000)
        in 7 byte insns.
        (disassemble): Handle SPLIT and EXTENDED operands.

opcodes/ChangeLog
opcodes/mn10300-dis.c

index fd30222115a9d03ccb071872895aefce11ded144..f937a1a85f604b09e9655f816f84e19301048e89 100644 (file)
@@ -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.
index 6c1b4d2ff363cb487c5cf9e021a002c5a83b43bd..4edd61417d9ac64ad02f666e999c68bad846f132 100644 (file)
@@ -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))