aboutsummaryrefslogtreecommitdiff
path: root/sim/msp430
diff options
context:
space:
mode:
Diffstat (limited to 'sim/msp430')
-rw-r--r--sim/msp430/ChangeLog4
-rw-r--r--sim/msp430/msp430-sim.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sim/msp430/ChangeLog b/sim/msp430/ChangeLog
index 21f5329..53fece0 100644
--- a/sim/msp430/ChangeLog
+++ b/sim/msp430/ChangeLog
@@ -1,3 +1,7 @@
+2015-12-15 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * msp430-sim.c (get_op, put_op): Fix left shift of negative value.
+
2015-12-07 Nick Clifton <nickc@redhat.com>
* msp430-sim.c (sim_open): Check for needed memory at address
diff --git a/sim/msp430/msp430-sim.c b/sim/msp430/msp430-sim.c
index 3a20f6c..6711858 100644
--- a/sim/msp430/msp430-sim.c
+++ b/sim/msp430/msp430-sim.c
@@ -364,7 +364,7 @@ get_op (SIM_DESC sd, MSP430_Opcode_Decoded *opc, int n)
/* Index values are signed. */
if (addr & (1 << (sign - 1)))
- addr |= -1 << sign;
+ addr |= -(1 << sign);
addr += reg;
@@ -565,7 +565,7 @@ put_op (SIM_DESC sd, MSP430_Opcode_Decoded *opc, int n, int val)
/* Index values are signed. */
if (addr & (1 << (sign - 1)))
- addr |= -1 << sign;
+ addr |= -(1 << sign);
addr += reg;