summaryrefslogtreecommitdiff
path: root/sim/h8300
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2003-07-18 00:08:23 +0000
committerMichael Snyder <msnyder@specifix.com>2003-07-18 00:08:23 +0000
commitf2a9dbd15f03c9b18129e416843bff8627169465 (patch)
treee0d480cc34b52b98e1e0dc97b39d8e192ad061e4 /sim/h8300
parent87458c597262048d83a39431c5df2486f88a6b1d (diff)
downloadgdb-f2a9dbd15f03c9b18129e416843bff8627169465.tar.gz
2003-07-17 Michael Snyder <msnyder@redhat.com>
* compile.c (decode): IMM16 is always zero-extended.
Diffstat (limited to 'sim/h8300')
-rw-r--r--sim/h8300/ChangeLog4
-rw-r--r--sim/h8300/compile.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index 2112ad92682..77cb91260dd 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,3 +1,7 @@
+2003-07-17 Michael Snyder <msnyder@redhat.com>
+
+ * compile.c (decode): IMM16 is always zero-extended.
+
2003-06-24 Michael Snyder <msnyder@redhat.com>
* sim-main.h (SIM_WIFSTOPPED, SIM_WSTOPSIG): Define.
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 7635655b3e5..3819fdd6929 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -818,7 +818,9 @@ decode (SIM_DESC sd, int addr, unsigned char *data, decoded_inst *dst)
(looking_for & SIZE) == L_16U)
{
cst[opnum] = (data[len / 2] << 8) + data[len / 2 + 1];
- if ((looking_for & SIZE) != L_16U)
+ /* Immediates are always unsigned. */
+ if ((looking_for & SIZE) != L_16U &&
+ (looking_for & MODE) != IMM)
cst[opnum] = (short) cst[opnum]; /* Sign extend. */
}
else if (looking_for & ABSJMP)