sim: correct cycle count when using constant generators

When the source register is R2 (SR) or R3 the cycle counts match
register mode for any value of the source-register addressing mode (As).
This commit is contained in:
Jason K. Smith 2014-12-15 11:04:57 -05:00 committed by Daniel Beer
parent c0d3fbe21a
commit 7abeef34c3
1 changed files with 5 additions and 0 deletions

View File

@ -221,6 +221,11 @@ static int step_double(struct sim_device *dev, uint16_t ins)
cycles = 2;
else
cycles = 3;
} else if (sreg == MSP430_REG_SR || sreg == MSP430_REG_R3) {
if (amode_dst == MSP430_AMODE_REGISTER)
cycles = 1;
else
cycles = 4;
} else {
if (amode_src == MSP430_AMODE_INDIRECT ||
amode_src == MSP430_AMODE_INDIRECT_INC)