diff options
author | Michael Meissner <gnu@the-meissners.org> | 1997-05-08 23:04:22 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 1997-05-08 23:04:22 +0000 |
commit | c3cad878c97ee7804b95d498cb3890e64088b8a8 (patch) | |
tree | fa377f77cea0f8214908d728a307e4f8daa9c4c7 /sim/tic80/insns | |
parent | 08168809b8a3de1898b4afb7f02b6db6d05ec92a (diff) | |
download | gdb-c3cad878c97ee7804b95d498cb3890e64088b8a8.zip gdb-c3cad878c97ee7804b95d498cb3890e64088b8a8.tar.gz gdb-c3cad878c97ee7804b95d498cb3890e64088b8a8.tar.bz2 |
Really fix the bbo/bbz instructions.
Diffstat (limited to 'sim/tic80/insns')
-rw-r--r-- | sim/tic80/insns | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sim/tic80/insns b/sim/tic80/insns index 6527833..c1a4467 100644 --- a/sim/tic80/insns +++ b/sim/tic80/insns @@ -107,7 +107,8 @@ void::function::do_and:signed32 *rDest, signed32 Source1, signed32 Source2 instruction_address::function::do_bbo:instruction_address nia, int bitnum, unsigned32 source, int annul, unsigned32 offset int jump_p; unsigned32 target = cia.ip + 4 * offset; - if (MASKED32 (source, 32 - bitnum, 32 - bitnum)) + bitnum = (~ bitnum) & 0x1f; + if (MASKED32 (source, bitnum, bitnum)) { if (annul) nia.ip = -1; @@ -131,7 +132,8 @@ instruction_address::function::do_bbo:instruction_address nia, int bitnum, unsig instruction_address::function::do_bbz:instruction_address nia, int bitnum, unsigned32 source, int annul, unsigned32 offset int jump_p; unsigned32 target = cia.ip + 4 * offset; - if (!MASKED32 (source, 32 - bitnum, 32 - bitnum)) + bitnum = (~ bitnum) & 0x1f; + if (!MASKED32 (source, bitnum, bitnum)) { if (annul) nia.ip = -1; |