dis: correct offset for symbolic single-operand and jumps.
This commit is contained in:
parent
a304b60dc9
commit
ce2e0a94f4
|
@ -269,7 +269,7 @@ static int decode_single(const uint8_t *code, address_t offset,
|
||||||
case MSP430_AMODE_INDEXED:
|
case MSP430_AMODE_INDEXED:
|
||||||
need_arg = 1;
|
need_arg = 1;
|
||||||
if (insn->dst_reg == MSP430_REG_PC) {
|
if (insn->dst_reg == MSP430_REG_PC) {
|
||||||
insn->dst_addr = offset + 2;
|
insn->dst_addr = offset + 4;
|
||||||
insn->dst_mode = MSP430_AMODE_SYMBOLIC;
|
insn->dst_mode = MSP430_AMODE_SYMBOLIC;
|
||||||
} else if (insn->dst_reg == MSP430_REG_SR) {
|
} else if (insn->dst_reg == MSP430_REG_SR) {
|
||||||
insn->dst_mode = MSP430_AMODE_ABSOLUTE;
|
insn->dst_mode = MSP430_AMODE_ABSOLUTE;
|
||||||
|
@ -413,7 +413,7 @@ static int decode_jump(const uint8_t *code, address_t offset,
|
||||||
|
|
||||||
insn->op = op & 0xfc00;
|
insn->op = op & 0xfc00;
|
||||||
insn->itype = MSP430_ITYPE_JUMP;
|
insn->itype = MSP430_ITYPE_JUMP;
|
||||||
insn->dst_addr = offset + 2 + tgtrel * 2;
|
insn->dst_addr = offset + 4 + tgtrel * 2;
|
||||||
insn->dst_mode = MSP430_AMODE_SYMBOLIC;
|
insn->dst_mode = MSP430_AMODE_SYMBOLIC;
|
||||||
insn->dst_reg = MSP430_REG_PC;
|
insn->dst_reg = MSP430_REG_PC;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue