aboutsummaryrefslogtreecommitdiff
path: root/sim/h8300/compile.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-04-06 00:21:35 +0000
committerJeff Law <law@redhat.com>1996-04-06 00:21:35 +0000
commite24146ec9529e0c028962910ac2efba45e42b9cf (patch)
treed76ec6064bb5b32bb113de6327ac4ad449543132 /sim/h8300/compile.c
parentd2f6ce6ac289c14bc476306a303d8d27793dac06 (diff)
downloadgdb-e24146ec9529e0c028962910ac2efba45e42b9cf.zip
gdb-e24146ec9529e0c028962910ac2efba45e42b9cf.tar.gz
gdb-e24146ec9529e0c028962910ac2efba45e42b9cf.tar.bz2
* compile.c (decode): Use "bit" to hold L_3 immediates instead
of holding them in "abs". Handle ABS8MEM memory references aka 8-bit area. Replace ABSMOV references with ABS8MEM. So we've got a chance of simulating something like btst #0,@40:8 correctly. hmse.
Diffstat (limited to 'sim/h8300/compile.c')
-rw-r--r--sim/h8300/compile.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 2545b1d..f55249e 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -153,6 +153,7 @@ decode (addr, data, dst)
int rdisp = 0;
int abs = 0;
int plen = 0;
+ int bit = 0;
struct h8_opcode *q = h8_opcodes;
int size = 0;
@@ -286,7 +287,13 @@ decode (addr, data, dst)
{
abs = SEXTCHAR (data[len >> 1]);
}
- else
+ else if (looking_for & ABS8MEM)
+ {
+ plen = 8;
+ abs = h8300hmode ? ~0xff0000ff : ~0xffff00ff;
+ abs |= data[len >> 1] & 0xff ;
+ }
+ else
{
abs = data[len >> 1] & 0xff;
}
@@ -295,7 +302,7 @@ decode (addr, data, dst)
{
plen = 3;
- abs = thisnib;
+ bit = thisnib;
}
else if (looking_for == E)
{
@@ -321,7 +328,12 @@ decode (addr, data, dst)
p = &(dst->src);
}
- if (x & (IMM | KBIT | DBIT))
+ if (x & (L_3))
+ {
+ p->type = X (OP_IMM, size);
+ p->literal = bit;
+ }
+ else if (x & (IMM | KBIT | DBIT))
{
p->type = X (OP_IMM, size);
p->literal = abs;
@@ -351,7 +363,7 @@ decode (addr, data, dst)
p->reg = rn & 0x7;
p->literal = 0;
}
- else if (x & (ABS | ABSJMP | ABSMOV))
+ else if (x & (ABS | ABSJMP | ABS8MEM))
{
p->type = X (OP_DISP, size);
p->literal = abs;
@@ -574,6 +586,11 @@ fetch (arg, n)
t &= cpu.mask;
return t;
+ case X (OP_MEM, SW):
+ t = GET_MEMORY_W (abs);
+ t &= cpu.mask;
+ return t;
+
default:
abort ();