* simops.c: Fix restoring the PC for "ret" and "retf" instructions.
authorJeff Law <law@redhat.com>
Mon, 16 Dec 1996 17:08:10 +0000 (17:08 +0000)
committerJeff Law <law@redhat.com>
Mon, 16 Dec 1996 17:08:10 +0000 (17:08 +0000)
sim/mn10300/ChangeLog
sim/mn10300/simops.c

index 3f726c8a1419e236a1272ce42a5dece84278e903..69a7b4dcc46a28234b18e5924f0e1a9e1d6bc801 100644 (file)
@@ -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.
index 02bf7b2ad5c479d7cdd9d7705ec0aeed67c91b74..ff0a915946061a81bc2fad9c0c2fa440049dc25d 100644 (file)
@@ -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 */
This page took 0.027339 seconds and 4 git commands to generate.