Apply H>J's patch to propogate changes made by Thomas de Lellis to arm.h
[deliverable/binutils-gdb.git] / opcodes / m10200-dis.c
index 9572f9ea85e9d70f5f38de5b5168beedc93ff2d1..022c7e3410b043a5931b93cddddc7e1264b7eac6 100644 (file)
@@ -45,6 +45,7 @@ print_insn_mn10200 (memaddr, info)
       (*info->memory_error_func) (status, memaddr, info);
       return -1;
     }
+
   insn = *(unsigned char *) buffer;
 
   /* These are one byte insns.  */
@@ -174,7 +175,7 @@ print_insn_mn10200 (memaddr, info)
          (*info->memory_error_func) (status, memaddr, info);
          return -1;
        }
-      insn |= *(unsigned char *)buffer << 8;
+      insn |= (*(unsigned char *)buffer << 8) & 0xff00;
 
       status = (*info->read_memory_func) (memaddr + 3, buffer, 1, info);
       if (status != 0)
@@ -182,7 +183,7 @@ print_insn_mn10200 (memaddr, info)
          (*info->memory_error_func) (status, memaddr, info);
          return -1;
        }
-      insn |= *(unsigned char *)buffer;
+      insn |= (*(unsigned char *)buffer) & 0xff;
 
       status = (*info->read_memory_func) (memaddr + 2, buffer, 1, info);
       if (status != 0)
@@ -190,7 +191,7 @@ print_insn_mn10200 (memaddr, info)
          (*info->memory_error_func) (status, memaddr, info);
          return -1;
        }
-      extension = *(unsigned char *)buffer;
+      extension = (*(unsigned char *)buffer) & 0xff;
       consume = 5;
     }
   else
@@ -272,7 +273,7 @@ disassemble (memaddr, info, insn, extension, size)
              else
                {
                  value = ((insn >> (operand->shift))
-                          & ((1 << operand->bits) - 1));
+                          & ((1L << operand->bits) - 1L));
                }
 
              if ((operand->flags & MN10200_OPERAND_SIGNED) != 0)
@@ -325,7 +326,7 @@ disassemble (memaddr, info, insn, extension, size)
                (*info->print_address_func) (value, info);
 
              else 
-               (*info->fprintf_func) (info->stream, "%d", value);
+               (*info->fprintf_func) (info->stream, "%ld", value);
            }
          /* All done. */
          break;
@@ -335,6 +336,6 @@ disassemble (memaddr, info, insn, extension, size)
 
   if (!match)
     {
-       (*info->fprintf_func) (info->stream, _("unknown\t0x%04x"), insn);
+       (*info->fprintf_func) (info->stream, _("unknown\t0x%04lx"), insn);
     }
 }
This page took 0.025649 seconds and 4 git commands to generate.