aboutsummaryrefslogtreecommitdiff
path: root/sim/mn10300
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1997-11-11 17:37:04 +0000
committerJeff Law <law@redhat.com>1997-11-11 17:37:04 +0000
commitfc615b0b1eb002a7304b68665c65d3a2a84dfb05 (patch)
tree01ac003d3b9e7a8fc1a784523b1a1863beae425e /sim/mn10300
parenta94c5493a74f965bb0fac3e0c6caf0621cb3097f (diff)
downloadgdb-fc615b0b1eb002a7304b68665c65d3a2a84dfb05.zip
gdb-fc615b0b1eb002a7304b68665c65d3a2a84dfb05.tar.gz
gdb-fc615b0b1eb002a7304b68665c65d3a2a84dfb05.tar.bz2
* simops.c (call:16 call:32): Stack adjustment is determined solely
by the imm8 field.
Diffstat (limited to 'sim/mn10300')
-rw-r--r--sim/mn10300/simops.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sim/mn10300/simops.c b/sim/mn10300/simops.c
index 3d82952..9a3f3a3 100644
--- a/sim/mn10300/simops.c
+++ b/sim/mn10300/simops.c
@@ -2586,8 +2586,10 @@ void OP_CD000000 (insn, extension)
sp -= 4;
}
- /* Update the stack pointer. */
- State.regs[REG_SP] = sp - extension;
+ /* Update the stack pointer, note that the register saves to do not
+ modify SP. The SP adjustment is derived totally from the imm8
+ field. */
+ State.regs[REG_SP] -= extension;
State.regs[REG_MDR] = next_pc;
State.regs[REG_PC] += SEXT16 ((insn & 0xffff00) >> 8) - 5;
}
@@ -2651,8 +2653,10 @@ void OP_DD000000 (insn, extension)
sp -= 4;
}
- /* Update the stack pointer. */
- State.regs[REG_SP] = sp - (extension & 0xff);
+ /* Update the stack pointer, note that the register saves to do not
+ modify SP. The SP adjustment is derived totally from the imm8
+ field. */
+ State.regs[REG_SP] -= (extension & 0xff);
State.regs[REG_MDR] = next_pc;
State.regs[REG_PC] += (((insn & 0xffffff) << 8) | ((extension & 0xff0000) >> 16)) - 7;
}