Fixed symbolic addressing mode
Due to a too early increment of the program counter all symbolic addressed x(PC) memory accesses have offseted by 2.
This commit is contained in:
parent
6fe57b02e4
commit
c141f5e5e1
|
@ -100,10 +100,11 @@ static int fetch_operand(struct sim_device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
addr = MEM_GETW(dev, dev->regs[MSP430_REG_PC]);
|
addr = MEM_GETW(dev, dev->regs[MSP430_REG_PC]);
|
||||||
dev->regs[MSP430_REG_PC] += 2;
|
|
||||||
|
|
||||||
if (reg != MSP430_REG_SR)
|
if (reg != MSP430_REG_SR)
|
||||||
addr += dev->regs[reg];
|
addr += dev->regs[reg];
|
||||||
|
|
||||||
|
dev->regs[MSP430_REG_PC] += 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP430_AMODE_INDIRECT:
|
case MSP430_AMODE_INDIRECT:
|
||||||
|
|
Loading…
Reference in New Issue