diff options
author | Jeff Law <law@redhat.com> | 1996-12-16 17:08:10 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1996-12-16 17:08:10 +0000 |
commit | 16d2e2b67020b95063ddcecc7556f206a5ffab30 (patch) | |
tree | 0b7ed5f8029f7d4dd9d5b0397f020df4b517e343 /sim | |
parent | 868c351306e35bcb0b5f9b76097e1262da316a79 (diff) | |
download | gdb-16d2e2b67020b95063ddcecc7556f206a5ffab30.zip gdb-16d2e2b67020b95063ddcecc7556f206a5ffab30.tar.gz gdb-16d2e2b67020b95063ddcecc7556f206a5ffab30.tar.bz2 |
* simops.c: Fix restoring the PC for "ret" and "retf" instructions.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/mn10300/ChangeLog | 11 | ||||
-rw-r--r-- | sim/mn10300/simops.c | 16 |
2 files changed, 23 insertions, 4 deletions
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index 3f726c8..69a7b4d 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,3 +1,14 @@ +Mon Dec 16 10:03:52 1996 Jeffrey A Law (law@cygnus.com) + + * simops.c: Fix restoring the PC for "ret" and "retf" instructions. + +Wed Dec 11 09:53:10 1996 Jeffrey A Law (law@cygnus.com) + + * gencode.c (write_opcodes): Also write out the format of the + opcode. + * mn10300_sim.h (simops): Add "format" field. + * interp.c (sim_resume): Deal with endianness issues here. + Tue Dec 10 15:05:37 1996 Jeffrey A Law (law@cygnus.com) * simops.c (REG0_4): Define. diff --git a/sim/mn10300/simops.c b/sim/mn10300/simops.c index 02bf7b2..ff0a915 100644 --- a/sim/mn10300/simops.c +++ b/sim/mn10300/simops.c @@ -2690,7 +2690,6 @@ void OP_DF0000 (insn, extension) unsigned long mask; State.regs[REG_SP] += insn & 0xff; - State.pc = State.regs[REG_MDR] - 3; sp = State.regs[REG_SP]; mask = (insn & 0xff00) >> 8; @@ -2737,6 +2736,14 @@ void OP_DF0000 (insn, extension) State.regs[REG_D0 + 2] = load_mem (sp, 4); sp += 4; } + + /* And make sure to update the stack pointer. */ + State.regs[REG_SP] = sp; + + /* Restore the PC value. */ + State.pc = (State.mem[sp] | (State.mem[sp+1] << 8) + | (State.mem[sp+2] << 16) | (State.mem[sp+3] << 24)); + State.pc -= 3; } /* retf reg_list,imm8 */ @@ -2748,9 +2755,7 @@ void OP_DE0000 (insn, extension) sp = State.regs[REG_SP] + (insn & 0xff); State.regs[REG_SP] = sp; - State.pc = (State.mem[sp] | (State.mem[sp+1] << 8) - | (State.mem[sp+2] << 16) | (State.mem[sp+3] << 24)); - State.pc -= 3; + State.pc = State.regs[REG_MDR] - 3; sp = State.regs[REG_SP]; @@ -2798,6 +2803,9 @@ void OP_DE0000 (insn, extension) State.regs[REG_D0 + 2] = load_mem (sp, 4); sp += 4; } + + /* And make sure to update the stack pointer. */ + State.regs[REG_SP] = sp; } /* rets */ |