# HG changeset patch # User Michael Pavone # Date 1462940787 25200 # Node ID 276cd582b7282a8cc528a33bf7825eb03283877a # Parent 7267bc1ab54708ac4919920a7d0db10d6e355d16 Fix PC value pushed to stack for A and F line traps diff -r 7267bc1ab547 -r 276cd582b728 m68k_core.c --- a/m68k_core.c Tue May 10 08:59:17 2016 -0700 +++ b/m68k_core.c Tue May 10 21:26:27 2016 -0700 @@ -334,11 +334,12 @@ void translate_m68k_trap(m68k_options *opts, m68kinst *inst) { code_info *code = &opts->gen.code; - uint32_t vector; + uint32_t vector, pc = inst->address; switch (inst->op) { case M68K_TRAP: vector = inst->src.params.immed + VECTOR_TRAP_0; + pc += 2; break; case M68K_A_LINE_TRAP: vector = VECTOR_LINE_1010; @@ -348,7 +349,7 @@ break; } ldi_native(opts, vector, opts->gen.scratch2); - ldi_native(opts, inst->address+2, opts->gen.scratch1); + ldi_native(opts, pc, opts->gen.scratch1); jmp(code, opts->trap); }