1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-11 08:30:55 +00:00

Add 'reset' functions.

This commit is contained in:
Thomas Harte 2022-06-07 16:55:39 -04:00
parent c4ae5d4c8d
commit 9009645cea
4 changed files with 17 additions and 0 deletions

View File

@ -462,6 +462,8 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform = false> cla
return e_clock_phase_;
}
void reset();
private:
T &bus_handler_;
};

View File

@ -2237,6 +2237,13 @@ void ProcessorStorage::set_status(uint16_t status) {
apply_status(status);
}
template <class T, bool dtack_is_implicit, bool signal_will_perform> void Processor<T, dtack_is_implicit, signal_will_perform>::reset() {
execution_state_ = ExecutionState::Executing;
active_step_ = reset_bus_steps_;
is_supervisor_ = 1;
interrupt_level_ = 7;
}
#undef status
#undef apply_status
#undef apply_ccr

View File

@ -441,6 +441,8 @@ class Processor: private ProcessorBase {
return e_clock_phase_;
}
void reset();
private:
BusHandler &bus_handler_;
};

View File

@ -2782,6 +2782,12 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
program_counter_.l += 2;
}
template <class BusHandler, bool dtack_is_implicit, bool permit_overrun, bool signal_will_perform>
void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perform>::reset() {
state_ = Reset;
status_.begin_exception(7);
}
}
}