comparison m68k_core_x86.c @ 2226:d15c68157288

Fix implementation ot 68K trapv instruction
author Michael Pavone <pavone@retrodev.com>
date Mon, 05 Sep 2022 12:00:02 -0700
parents e22137f0aca4
children 0c42982dd4d8
comparison
equal deleted inserted replaced
2225:e22137f0aca4 2226:d15c68157288
2391 } 2391 }
2392 2392
2393 void translate_m68k_trapv(m68k_options *opts, m68kinst *inst) 2393 void translate_m68k_trapv(m68k_options *opts, m68kinst *inst)
2394 { 2394 {
2395 code_info *code = &opts->gen.code; 2395 code_info *code = &opts->gen.code;
2396 cycles(&opts->gen, BUS);
2397 flag_to_carry(opts, FLAG_V); 2396 flag_to_carry(opts, FLAG_V);
2398 code_ptr no_trap = code->cur + 1; 2397 code_ptr no_trap = code->cur + 1;
2399 jcc(code, CC_NC, no_trap); 2398 jcc(code, CC_NC, no_trap);
2400 ldi_native(opts, VECTOR_TRAPV, opts->gen.scratch2); 2399 ldi_native(opts, VECTOR_TRAPV, opts->gen.scratch2);
2401 ldi_native(opts, inst->address+2, opts->gen.scratch1); 2400 ldi_native(opts, inst->address+2, opts->gen.scratch1);
2402 jmp(code, opts->trap); 2401 jmp(code, opts->trap);
2403 *no_trap = code->cur - (no_trap + 1); 2402 *no_trap = code->cur - (no_trap + 1);
2403 cycles(&opts->gen, BUS);
2404 } 2404 }
2405 2405
2406 void translate_m68k_odd(m68k_options *opts, m68kinst *inst) 2406 void translate_m68k_odd(m68k_options *opts, m68kinst *inst)
2407 { 2407 {
2408 code_info *code = &opts->gen.code; 2408 code_info *code = &opts->gen.code;