summaryrefslogtreecommitdiff
path: root/m68k_core.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-04-26 00:07:15 -0700
committerMichael Pavone <pavone@retrodev.com>2016-04-26 00:07:15 -0700
commit042768acd31ac2a59049db55e31b647c2eb51818 (patch)
treee8f9eb1e0b9098c558aa9ff0f7bee7ace8c6fc27 /m68k_core.c
parentf648307598ab5c06261ef7bd9b27308cda8f1a4e (diff)
Implement illegal instruction trap
Diffstat (limited to 'm68k_core.c')
-rw-r--r--m68k_core.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/m68k_core.c b/m68k_core.c
index bbc5abd..b687045 100644
--- a/m68k_core.c
+++ b/m68k_core.c
@@ -339,6 +339,15 @@ void translate_m68k_trap(m68k_options *opts, m68kinst *inst)
jmp(code, opts->trap);
}
+void translate_m68k_illegal(m68k_options *opts, m68kinst *inst)
+{
+ code_info *code = &opts->gen.code;
+ cycles(&opts->gen, BUS);
+ ldi_native(opts, VECTOR_ILLEGAL_INST, opts->gen.scratch2);
+ ldi_native(opts, inst->address, opts->gen.scratch1);
+ jmp(code, opts->trap);
+}
+
void translate_m68k_move_usp(m68k_options *opts, m68kinst *inst)
{
cycles(&opts->gen, BUS);
@@ -800,7 +809,7 @@ impl_info m68k_impls[] = {
RAW_IMPL(M68K_TRAP, translate_m68k_trap),
RAW_IMPL(M68K_TRAPV, translate_m68k_trapv),
RAW_IMPL(M68K_ILLEGAL, translate_m68k_illegal),
- RAW_IMPL(M68K_INVALID, translate_m68k_invalid),
+ RAW_IMPL(M68K_INVALID, translate_m68k_illegal),
//misc
RAW_IMPL(M68K_NOP, translate_m68k_nop),