From a1f73f4ae60d0d2cff6e8619417c15c97460239b Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Thu, 29 Oct 2015 19:06:06 -0700 Subject: Implement TRAPV --- m68k_core_x86.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'm68k_core_x86.c') diff --git a/m68k_core_x86.c b/m68k_core_x86.c index f23c51d..fff5855 100644 --- a/m68k_core_x86.c +++ b/m68k_core_x86.c @@ -2116,6 +2116,19 @@ void translate_m68k_stop(m68k_options *opts, m68kinst *inst) jcc(code, CC_C, loop_top); } +void translate_m68k_trapv(m68k_options *opts, m68kinst *inst) +{ + code_info *code = &opts->gen.code; + cycles(&opts->gen, BUS); + flag_to_carry(opts, FLAG_V); + code_ptr no_trap = code->cur + 1; + jcc(code, CC_NC, no_trap); + ldi_native(opts, VECTOR_TRAPV, opts->gen.scratch2); + ldi_native(opts, inst->address+2, opts->gen.scratch1); + jmp(code, opts->trap); + *no_trap = code->cur - (no_trap + 1); +} + void translate_m68k_move_from_sr(m68k_options *opts, m68kinst *inst, host_ea *src_op, host_ea *dst_op) { code_info *code = &opts->gen.code; -- cgit v1.2.3