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:
Mario Werner 2013-01-13 17:30:39 +01:00 committed by Daniel Beer
parent 6fe57b02e4
commit c141f5e5e1
1 changed files with 2 additions and 1 deletions

View File

@ -100,10 +100,11 @@ 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: