From 3bdd7df1517185e8a9ea9841f0d999b90ee07960 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Wed, 27 Apr 2016 23:11:24 -0700 Subject: Implement privelege violation exceptions --- m68k_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'm68k_core.c') diff --git a/m68k_core.c b/m68k_core.c index 69cd94d..16614a7 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -350,6 +350,7 @@ void translate_m68k_illegal(m68k_options *opts, m68kinst *inst) void translate_m68k_move_usp(m68k_options *opts, m68kinst *inst) { + m68k_trap_if_not_supervisor(opts, inst); cycles(&opts->gen, BUS); int8_t reg; if (inst->src.addr_mode == MODE_UNUSED) { @@ -532,8 +533,9 @@ void translate_m68k_reset(m68k_options *opts, m68kinst *inst) void translate_m68k_rte(m68k_options *opts, m68kinst *inst) { + m68k_trap_if_not_supervisor(opts, inst); + code_info *code = &opts->gen.code; - //TODO: Trap if not in system mode //Read saved SR areg_to_native(opts, 7, opts->gen.scratch1); call(code, opts->read_16); -- cgit v1.2.3