2020-09-28 02:20:58 +00:00
|
|
|
//
|
|
|
|
// 65816Implementation.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 27/09/2020.
|
|
|
|
// Copyright © 2020 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles cycles) {
|
|
|
|
auto int_cycles = cycles.as_integral();
|
|
|
|
while(int_cycles--) {
|
|
|
|
const MicroOp operation = *next_op_;
|
|
|
|
++next_op_;
|
|
|
|
|
|
|
|
switch(operation) {
|
|
|
|
case OperationMoveToNextProgram:
|
|
|
|
// The exception program will determine the appropriate way to respond
|
|
|
|
// based on the pending exception if one exists; otherwise just do a
|
|
|
|
// standard fetch-decode-execute.
|
2020-09-29 01:35:46 +00:00
|
|
|
next_op_ = µ_ops_[instructions[pending_exceptions_ ? size_t(OperationSlot::Exception) : size_t(OperationSlot::FetchDecodeExecute)].program_offset];
|
2020-09-28 22:43:53 +00:00
|
|
|
|
|
|
|
// TODO: reset instruction buffer.
|
2020-09-28 02:20:58 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-09-29 01:35:46 +00:00
|
|
|
|
|
|
|
void ProcessorBase::set_power_on(bool) {}
|
|
|
|
void ProcessorBase::set_irq_line(bool) {}
|
|
|
|
void ProcessorBase::set_nmi_line(bool) {}
|
|
|
|
bool ProcessorBase::is_jammed() const { return false; }
|