aboutsummaryrefslogtreecommitdiff
path: root/cpu/m32r.opc
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/m32r.opc')
-rw-r--r--cpu/m32r.opc8
1 files changed, 6 insertions, 2 deletions
diff --git a/cpu/m32r.opc b/cpu/m32r.opc
index f2351b1..ab69d07 100644
--- a/cpu/m32r.opc
+++ b/cpu/m32r.opc
@@ -127,7 +127,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;
}
@@ -142,8 +145,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;