comparison m68k_core.c @ 992:261995d06897

Implemented A line and F line traps.
author Michael Pavone <pavone@retrodev.com>
date Thu, 28 Apr 2016 09:00:42 -0700
parents 33a46d35b913
children 276cd582b728
comparison
equal deleted inserted replaced
991:f9ee6f746cb4 992:261995d06897
332 } 332 }
333 333
334 void translate_m68k_trap(m68k_options *opts, m68kinst *inst) 334 void translate_m68k_trap(m68k_options *opts, m68kinst *inst)
335 { 335 {
336 code_info *code = &opts->gen.code; 336 code_info *code = &opts->gen.code;
337 ldi_native(opts, inst->src.params.immed + VECTOR_TRAP_0, opts->gen.scratch2); 337 uint32_t vector;
338 switch (inst->op)
339 {
340 case M68K_TRAP:
341 vector = inst->src.params.immed + VECTOR_TRAP_0;
342 break;
343 case M68K_A_LINE_TRAP:
344 vector = VECTOR_LINE_1010;
345 break;
346 case M68K_F_LINE_TRAP:
347 vector = VECTOR_LINE_1111;
348 break;
349 }
350 ldi_native(opts, vector, opts->gen.scratch2);
338 ldi_native(opts, inst->address+2, opts->gen.scratch1); 351 ldi_native(opts, inst->address+2, opts->gen.scratch1);
339 jmp(code, opts->trap); 352 jmp(code, opts->trap);
340 } 353 }
341 354
342 void translate_m68k_illegal(m68k_options *opts, m68kinst *inst) 355 void translate_m68k_illegal(m68k_options *opts, m68kinst *inst)
816 RAW_IMPL(M68K_STOP, translate_m68k_stop), 829 RAW_IMPL(M68K_STOP, translate_m68k_stop),
817 830
818 //traps 831 //traps
819 OP_IMPL(M68K_CHK, translate_m68k_chk), 832 OP_IMPL(M68K_CHK, translate_m68k_chk),
820 RAW_IMPL(M68K_TRAP, translate_m68k_trap), 833 RAW_IMPL(M68K_TRAP, translate_m68k_trap),
834 RAW_IMPL(M68K_A_LINE_TRAP, translate_m68k_trap),
835 RAW_IMPL(M68K_F_LINE_TRAP, translate_m68k_trap),
821 RAW_IMPL(M68K_TRAPV, translate_m68k_trapv), 836 RAW_IMPL(M68K_TRAPV, translate_m68k_trapv),
822 RAW_IMPL(M68K_ILLEGAL, translate_m68k_illegal), 837 RAW_IMPL(M68K_ILLEGAL, translate_m68k_illegal),
823 RAW_IMPL(M68K_INVALID, translate_m68k_illegal), 838 RAW_IMPL(M68K_INVALID, translate_m68k_illegal),
824 839
825 //misc 840 //misc