From 29cfc22f891b09394ff485fe18c2e2f0c3c80b0f Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Tue, 14 Dec 2010 23:12:20 +0000 Subject: [PATCH] * rx.c (decode_opcode): For "MVFC PC,", use the address of the opcode, not the address following the opcode. --- sim/rx/ChangeLog | 5 +++++ sim/rx/rx.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog index 16678f86242..c0b4b5dda64 100644 --- a/sim/rx/ChangeLog +++ b/sim/rx/ChangeLog @@ -1,3 +1,8 @@ +2010-12-14 DJ Delorie + + * rx.c (decode_opcode): For "MVFC PC,", use the address of the + opcode, not the address following the opcode. + 2010-11-11 DJ Delorie * rx.c (lsb_count): New. diff --git a/sim/rx/rx.c b/sim/rx/rx.c index 881dc66fa2c..5fb11d9f8c7 100644 --- a/sim/rx/rx.c +++ b/sim/rx/rx.c @@ -1379,6 +1379,14 @@ decode_opcode () case RXO_mov: v = GS (); + if (opcode->op[1].type == RX_Operand_Register + && opcode->op[1].reg == 17 /* PC */) + { + /* Special case. We want the address of the insn, not the + address of the next insn. */ + v = opcode_pc; + } + if (opcode->op[0].type == RX_Operand_Register && opcode->op[0].reg == 16 /* PSW */) { -- 2.30.2