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:
Daniel Beer 2013-03-26 09:25:33 +13:00
parent da3b7e31a2
commit eacf4b8be4
1 changed files with 2 additions and 2 deletions

View File

@ -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: