diff --git a/Processors/68000/Implementation/68000Implementation.hpp b/Processors/68000/Implementation/68000Implementation.hpp index 2b5cc3fd0..a69941654 100644 --- a/Processors/68000/Implementation/68000Implementation.hpp +++ b/Processors/68000/Implementation/68000Implementation.hpp @@ -150,8 +150,18 @@ template void Proces } if(instructions[decoded_instruction_].micro_operations) { - active_program_ = &instructions[decoded_instruction_]; - active_micro_op_ = active_program_->micro_operations; + // Check for a privilege violation. + if(instructions[decoded_instruction_].requires_supervisor && !is_supervisor_) { + // TODO: this isn't the correct set of bus steps; this exception should + // push more informatio to the stack. + active_program_ = nullptr; + active_micro_op_ = exception_micro_ops_; + populate_trap_steps(8, get_status()); + } else { + // Standard instruction dispatch. + active_program_ = &instructions[decoded_instruction_]; + active_micro_op_ = active_program_->micro_operations; + } } else { active_program_ = nullptr; active_micro_op_ = exception_micro_ops_;