diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-10-29 19:06:06 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-10-29 19:06:06 -0700 |
commit | a1f73f4ae60d0d2cff6e8619417c15c97460239b (patch) | |
tree | 1f2c087036ad375e6cf75b735936c17ddd4df97d /m68k_core_x86.c | |
parent | 3a8f89cb47c0715d091dde6e317cebf9a4796778 (diff) |
Implement TRAPV
Diffstat (limited to 'm68k_core_x86.c')
-rw-r--r-- | m68k_core_x86.c | 13 |
1 files changed, 13 insertions, 0 deletions
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; |