Fix immediate-mode addressing with byte instructions.

Immediate mode is implemented using auto-increment register indexing,
but the advance is always 2 for PC-indexed operands.

Bug introduced in 2aed1b90a4.
This commit is contained in:
Daniel Beer 2011-09-13 13:36:19 +12:00
parent 02c355afe2
commit edf625929c
1 changed files with 1 additions and 1 deletions

2
sim.c
View File

@ -110,7 +110,7 @@ static int fetch_operand(struct sim_device *dev,
return 0;
}
addr = dev->regs[reg];
dev->regs[reg] += is_byte ? 1 : 2;
dev->regs[reg] += (is_byte && reg != MSP430_REG_PC) ? 1 : 2;
break;
}