/* rl78.c --- opcode semantics for stand-alone RL78 simulator.
- Copyright (C) 2008-2013 Free Software Foundation, Inc.
+ Copyright (C) 2008-2021 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of the GNU simulators.
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
op_flags (int before, int after, int mask, RL78_Size size)
{
int vmask, cmask, amask, avmask;
+ int psw;
if (size == RL78_Word)
{
avmask = 0x0f;
}
- int psw = get_reg (RL78_Reg_PSW);
+ psw = get_reg (RL78_Reg_PSW);
psw &= ~mask;
if (mask & RL78_PSW_CY)
int a, b, v, v2;
unsigned int u, u2;
int obits;
+ RL78_Dis_Isa isa;
+
+ isa = (rl78_g10_mode ? RL78_ISA_G10
+ : g14_multiply ? RL78_ISA_G14
+ : g13_multiply ? RL78_ISA_G13
+ : RL78_ISA_DEFAULT);
rl78_data.dpc = pc;
opcode_size = rl78_decode_opcode (pc, &opcode,
- rl78_get_byte, &rl78_data);
+ rl78_get_byte, &rl78_data, isa);
opcode_pc = pc;
pc += opcode_size;
rl78_data.dpc = pc;
opcode_size = rl78_decode_opcode (pc, &opcode,
- rl78_get_byte, &rl78_data);
+ rl78_get_byte, &rl78_data, isa);
pc += opcode_size;
tprintf (" skipped: %s\n", opcode.syntax);
break;