// // Executor.cpp // Clock Signal // // Created by Thomas Harte on 29/04/2022. // Copyright © 2022 Thomas Harte. All rights reserved. // #include "Executor.hpp" using namespace InstructionSet::M68k; template Executor::Executor(BusHandler &handler) : bus_handler_(handler) { reset(); } template void Executor::reset() { } template void Executor::run_for_instructions(int count) { while(count--) { // TODO: check interrupt level, trace flag. // Read the next instruction. const Preinstruction instruction = decoder_.decode(bus_handler_.template read(program_counter_.l)); const auto instruction_address = program_counter_.l; program_counter_.l += 2; // Obtain the appropriate sequence. Sequence sequence(instruction.operation); // Perform it. while(!sequence.empty()) { const auto step = sequence.pop_front(); } } }