sim: bug fix: @SP+ always increments by 2.
The same rules for PC apply to the stack pointer. Even when byte-mode instructions are executed, the stack pointer is incremented by a whole word when using the indirect increment addressing mode.
This commit is contained in:
parent
55671036a6
commit
ad4e27c1a2
|
@ -134,7 +134,8 @@ static int fetch_operand(struct sim_device *dev,
|
|||
return 0;
|
||||
}
|
||||
addr = dev->regs[reg];
|
||||
dev->regs[reg] += (is_byte && reg != MSP430_REG_PC) ? 1 : 2;
|
||||
dev->regs[reg] += (is_byte && reg != MSP430_REG_PC &&
|
||||
reg != MSP430_REG_SP) ? 1 : 2;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue