1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-04-06 10:38:16 +00:00

Have TRAP and TRAPV push the next instruction address to the stack.

This commit is contained in:
Thomas Harte 2022-05-25 11:47:21 -04:00
parent 9709b9b1b1
commit 5db6a937cb

View File

@ -2425,6 +2425,7 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
// or that of the instruction after?
BeginState(TRAP):
IdleBus(2);
instruction_address_.l += 2; // Push the address of the instruction after the trap.
exception_vector_ = (opcode_ & 15) + InstructionSet::M68k::Exception::TrapBase;
MoveToStateSpecific(StandardException);
@ -2433,6 +2434,7 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
if(!status_.overflow_flag) {
MoveToStateSpecific(Decode);
}
instruction_address_.l += 2; // Push the address of the instruction after the trap.
exception_vector_ = InstructionSet::M68k::Exception::TRAPV;
MoveToStateSpecific(StandardException);