sim: fix PC-relative operand fetch.
Index should be relative to the value of PC after fetching the index word.
This commit is contained in:
parent
da3b7e31a2
commit
eacf4b8be4
|
@ -100,10 +100,10 @@ static int fetch_operand(struct sim_device *dev,
|
|||
}
|
||||
|
||||
addr = MEM_GETW(dev, dev->regs[MSP430_REG_PC]);
|
||||
dev->regs[MSP430_REG_PC] += 2;
|
||||
|
||||
if (reg != MSP430_REG_SR)
|
||||
addr += dev->regs[reg];
|
||||
|
||||
dev->regs[MSP430_REG_PC] += 2;
|
||||
break;
|
||||
|
||||
case MSP430_AMODE_INDIRECT:
|
||||
|
|
Loading…
Reference in New Issue