From 7abeef34c3e74d2da78ae5ea05f74658302253c8 Mon Sep 17 00:00:00 2001 From: "Jason K. Smith" Date: Mon, 15 Dec 2014 11:04:57 -0500 Subject: [PATCH] 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). --- drivers/sim.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/sim.c b/drivers/sim.c index 99d3ceb..5415257 100644 --- a/drivers/sim.c +++ b/drivers/sim.c @@ -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)