summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-04-29 22:58:45 -0700
committerMike Pavone <pavone@retrodev.com>2013-04-29 22:58:45 -0700
commitae4a60bf38d7942d2b75a98588a76e80c28047d2 (patch)
treeb49ee9113dc481cd1220b9c39e4c2434afd4c5a4
parentce28b14ff4a8f56a7f9653db90a1aa685714dda6 (diff)
Fix decoding of address in JP and JPCC instructions in the Z80 core
-rw-r--r--z80inst.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/z80inst.c b/z80inst.c
index 7e2f4f5..0acbb17 100644
--- a/z80inst.c
+++ b/z80inst.c
@@ -1249,7 +1249,7 @@ uint8_t * z80_decode(uint8_t * istream, z80inst * decoded)
}
if ((decoded->addr_mode & 0x1F) == Z80_IMMED && decoded->op != Z80_RST && decoded->op != Z80_IM) {
decoded->immed = *(++istream);
- if ((decoded->reg >= Z80_BC && decoded->reg < Z80_UNUSED) || decoded->op == Z80_CALL || decoded->op == Z80_CALLCC) {
+ if ((decoded->reg >= Z80_BC && decoded->reg < Z80_UNUSED) || decoded->op == Z80_CALL || decoded->op == Z80_CALLCC || decoded->op == Z80_JP || decoded->op == Z80_JPCC) {
decoded->immed |= *(++istream) << 8;
} else if (decoded->immed & 0x80) {
decoded->immed |= 0xFF00;