comparison m68k_core_x86.c @ 986:f680fe746a7d

Implement illegal instruction trap
author Michael Pavone <pavone@retrodev.com>
date Tue, 26 Apr 2016 00:07:15 -0700
parents 751280fb4494
children 1f09994e92c5
comparison
equal deleted inserted replaced
985:751280fb4494 986:f680fe746a7d
1386 } 1386 }
1387 update_flags(opts, flag_mask); 1387 update_flags(opts, flag_mask);
1388 m68k_save_result(inst, opts); 1388 m68k_save_result(inst, opts);
1389 } 1389 }
1390 1390
1391 void translate_m68k_invalid(m68k_options *opts, m68kinst *inst)
1392 {
1393 code_info *code = &opts->gen.code;
1394 if (inst->src.params.immed == 0x7100) {
1395 retn(code);
1396 return;
1397 }
1398 mov_ir(code, (int64_t)stderr, RDI, SZ_PTR);
1399 mov_ir(code, (int64_t)"Invalid instruction at %X\n", RSI, SZ_PTR);
1400 mov_ir(code, inst->address, RDX, SZ_D);
1401 call_args_abi(code, (code_ptr)fprintf, 3, RDI, RSI, RDX);
1402 mov_ir(code, 1, RDI, SZ_D);
1403 call_args(code, (code_ptr)exit, 1, RDI);
1404 }
1405
1406 void translate_m68k_abcd_sbcd(m68k_options *opts, m68kinst *inst, host_ea *src_op, host_ea *dst_op) 1391 void translate_m68k_abcd_sbcd(m68k_options *opts, m68kinst *inst, host_ea *src_op, host_ea *dst_op)
1407 { 1392 {
1408 code_info *code = &opts->gen.code; 1393 code_info *code = &opts->gen.code;
1409 if (inst->op == M68K_NBCD) { 1394 if (inst->op == M68K_NBCD) {
1410 if (dst_op->base != opts->gen.scratch2) { 1395 if (dst_op->base != opts->gen.scratch2) {
1979 } else { 1964 } else {
1980 cmp_irdisp(code, 0, dst_op->base, dst_op->disp, inst->extra.size); 1965 cmp_irdisp(code, 0, dst_op->base, dst_op->disp, inst->extra.size);
1981 } 1966 }
1982 update_flags(opts, Z|N); 1967 update_flags(opts, Z|N);
1983 } 1968 }
1984 }
1985
1986 void translate_m68k_illegal(m68k_options *opts, m68kinst *inst)
1987 {
1988 code_info *code = &opts->gen.code;
1989 call(code, opts->gen.save_context);
1990 call_args(code, (code_ptr)print_regs_exit, 1, opts->gen.context_reg);
1991 } 1969 }
1992 1970
1993 #define BIT_SUPERVISOR 5 1971 #define BIT_SUPERVISOR 5
1994 1972
1995 void translate_m68k_andi_ori_ccr_sr(m68k_options *opts, m68kinst *inst) 1973 void translate_m68k_andi_ori_ccr_sr(m68k_options *opts, m68kinst *inst)