1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-02 19:54:35 +00:00

Adds a check for instruction privilege violation, albeit that I think I need different bus steps.

This commit is contained in:
Thomas Harte 2019-04-29 19:06:10 -04:00
parent 3e34ae67f6
commit 2c1d8fa18a

View File

@ -150,8 +150,18 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> 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_;