comparison m68k_core_x86.c @ 839:4556818b6847

Implement TRAPV
author Michael Pavone <pavone@retrodev.com>
date Thu, 29 Oct 2015 19:06:06 -0700
parents f2cd380adebe
children 98d7b6073163
comparison
equal deleted inserted replaced
838:9a5dc22297f2 839:4556818b6847
2112 *normal_cycle_up = code->cur - (normal_cycle_up + 1); 2112 *normal_cycle_up = code->cur - (normal_cycle_up + 1);
2113 mov_rr(code, opts->gen.limit, opts->gen.cycles, SZ_D); 2113 mov_rr(code, opts->gen.limit, opts->gen.cycles, SZ_D);
2114 *after_cycle_up = code->cur - (after_cycle_up+1); 2114 *after_cycle_up = code->cur - (after_cycle_up+1);
2115 cmp_rdispr(code, opts->gen.context_reg, offsetof(m68k_context, int_cycle), opts->gen.cycles, SZ_D); 2115 cmp_rdispr(code, opts->gen.context_reg, offsetof(m68k_context, int_cycle), opts->gen.cycles, SZ_D);
2116 jcc(code, CC_C, loop_top); 2116 jcc(code, CC_C, loop_top);
2117 }
2118
2119 void translate_m68k_trapv(m68k_options *opts, m68kinst *inst)
2120 {
2121 code_info *code = &opts->gen.code;
2122 cycles(&opts->gen, BUS);
2123 flag_to_carry(opts, FLAG_V);
2124 code_ptr no_trap = code->cur + 1;
2125 jcc(code, CC_NC, no_trap);
2126 ldi_native(opts, VECTOR_TRAPV, opts->gen.scratch2);
2127 ldi_native(opts, inst->address+2, opts->gen.scratch1);
2128 jmp(code, opts->trap);
2129 *no_trap = code->cur - (no_trap + 1);
2117 } 2130 }
2118 2131
2119 void translate_m68k_move_from_sr(m68k_options *opts, m68kinst *inst, host_ea *src_op, host_ea *dst_op) 2132 void translate_m68k_move_from_sr(m68k_options *opts, m68kinst *inst, host_ea *src_op, host_ea *dst_op)
2120 { 2133 {
2121 code_info *code = &opts->gen.code; 2134 code_info *code = &opts->gen.code;