aboutsummaryrefslogtreecommitdiff
path: root/cpu/m32c.opc
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/m32c.opc')
-rw-r--r--cpu/m32c.opc20
1 files changed, 20 insertions, 0 deletions
diff --git a/cpu/m32c.opc b/cpu/m32c.opc
index 19547ae..ef0ac3b 100644
--- a/cpu/m32c.opc
+++ b/cpu/m32c.opc
@@ -433,6 +433,26 @@ parse_unsigned24 (CGEN_CPU_DESC cd, const char **strp,
return 0;
}
+/* This should only be used for #imm->reg. */
+static const char *
+parse_signed24 (CGEN_CPU_DESC cd, const char **strp,
+ int opindex, signed long *valuep)
+{
+ const char *errmsg = 0;
+ signed long value;
+
+ PARSE_SIGNED;
+
+ if (value <= 0xffffff && value > 0x7fffff)
+ value -= 0x1000000;
+
+ if (value > 0xffffff)
+ return _("dsp:24 immediate is out of range");
+
+ *valuep = value;
+ return 0;
+}
+
static const char *
parse_signed32 (CGEN_CPU_DESC cd, const char **strp,
int opindex, signed long *valuep)