* expr.c (operand <case '$'>): Use DOLLAR_AMBIGU rather than flag_mri_m68k
[deliverable/binutils-gdb.git] / opcodes / m32r-asm.c
index acb07629ae98c7534a1f2b7c560fa442644d3ab6..a5bd363316820879121a30bbb99f594a5ac1fe3c 100644 (file)
@@ -49,7 +49,6 @@ static const char * parse_insn_normal
 /* -- assembler routines inserted here.  */
 
 /* -- asm.c */
-
 static const char * MISSING_CLOSING_PARENTHESIS = N_("missing `)'");
 
 /* Handle '#' prefixes (i.e. skip over them).  */
@@ -90,7 +89,10 @@ parse_hi16 (CGEN_CPU_DESC cd,
       ++*strp;
       if (errmsg == NULL
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
-       value >>= 16;
+       {
+         value >>= 16;
+         value &= 0xffff;
+       }
       *valuep = value;
       return errmsg;
     }
@@ -105,8 +107,9 @@ parse_hi16 (CGEN_CPU_DESC cd,
       if (errmsg == NULL
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
         {
-          value = value + (value & 0x8000 ? 0x10000 : 0);
+          value += 0x8000;
           value >>= 16;
+         value &= 0xffff;
         }
       *valuep = value;
       return errmsg;
@@ -120,7 +123,10 @@ parse_hi16 (CGEN_CPU_DESC cd,
    handles the case where low() isn't present.  */
 
 static const char *
-parse_slo16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep)
+parse_slo16 (CGEN_CPU_DESC cd,
+            const char ** strp,
+            int opindex,
+            long * valuep)
 {
   const char *errmsg;
   enum cgen_parse_operand_result result_type;
@@ -139,11 +145,7 @@ parse_slo16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep)
       ++*strp;
       if (errmsg == NULL
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
-        {
-         value &= 0xffff;
-          if (value & 0x8000)
-             value |= 0xffff0000;
-        }
+       value = ((value & 0xffff) ^ 0x8000) - 0x8000;    
       *valuep = value;
       return errmsg;
     }
This page took 0.023424 seconds and 4 git commands to generate.