1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Give Program full ownership of the sentinel value.

In case I want to reduce the size of this field later.
This commit is contained in:
Thomas Harte 2021-12-23 16:32:21 -05:00
parent 32e0a66610
commit f20940a37b
2 changed files with 4 additions and 2 deletions

View File

@ -332,7 +332,7 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
// should_log = (fetched_pc >= 0x408D66) && (fetched_pc <= 0x408D84);
#endif
if(instructions[decoded_instruction_.full].micro_operations != std::numeric_limits<uint32_t>::max()) {
if(instructions[decoded_instruction_.full].micro_operations != Program::NoSuchProgram) {
if((instructions[decoded_instruction_.full].requires_supervisor) && !is_supervisor_) {
// A privilege violation has been detected.
active_program_ = nullptr;

View File

@ -368,9 +368,11 @@ class ProcessorStorage {
source_offset = 0;
}
static constexpr uint32_t NoSuchProgram = std::numeric_limits<uint32_t>::max();
/// The offset into the all_micro_ops_ at which micro-ops for this instruction begin,
/// or std::numeric_limits<uint32_t>::max() if this is an invalid Program.
uint32_t micro_operations = std::numeric_limits<uint32_t>::max();
uint32_t micro_operations = NoSuchProgram;
/// The overarching operation applied by this program when the moment comes.
Operation operation;
/// The number of bytes after the beginning of an instance of ProcessorStorage that the RegisterPair32 containing