2022-04-28 19:35:40 +00:00
|
|
|
//
|
|
|
|
// Perform.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 28/04/2022.
|
|
|
|
// Copyright © 2022 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef InstructionSets_M68k_Perform_h
|
|
|
|
#define InstructionSets_M68k_Perform_h
|
|
|
|
|
|
|
|
#include "Model.hpp"
|
|
|
|
#include "Instruction.hpp"
|
|
|
|
#include "Status.hpp"
|
|
|
|
#include "../../Numeric/RegisterSizes.hpp"
|
|
|
|
|
|
|
|
namespace InstructionSet {
|
|
|
|
namespace M68k {
|
|
|
|
|
2022-04-29 00:42:04 +00:00
|
|
|
struct NullFlowController {
|
2022-04-28 19:35:40 +00:00
|
|
|
void raise_exception(int) {}
|
|
|
|
void consume_cycles(int) {}
|
|
|
|
};
|
|
|
|
|
2022-05-01 21:39:56 +00:00
|
|
|
/// Performs @c instruction using @c source and @c dest (which mmay be ignored as per the semantics of the operation).
|
2022-04-29 11:57:02 +00:00
|
|
|
/// And change in processor status will be applied to @c status. If this operation raises an exception, causes a
|
2022-04-29 00:42:04 +00:00
|
|
|
/// branch, or consumes additional cycles due to the particular value of the operands (on the 68000, think DIV or MUL),
|
|
|
|
/// that'll be notified to the @c flow_controller.
|
2022-05-01 21:39:56 +00:00
|
|
|
///
|
|
|
|
/// If the template parameter @c operation is not @c Operation::Undefined then that operation will be performed, ignoring
|
|
|
|
/// whatever is specifed in @c instruction. This allows selection either at compile time or at run time; per Godbolt all modern
|
|
|
|
/// compilers seem to be smart enough fully to optimise the compile-time case.
|
2022-04-28 19:35:40 +00:00
|
|
|
template <
|
|
|
|
Model model,
|
2022-05-01 21:39:56 +00:00
|
|
|
typename FlowController,
|
|
|
|
Operation operation = Operation::Undefined
|
2022-04-30 18:08:51 +00:00
|
|
|
> void perform(Preinstruction instruction, CPU::RegisterPair32 &source, CPU::RegisterPair32 &dest, Status &status, FlowController &flow_controller);
|
2022-04-28 19:35:40 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-28 20:55:47 +00:00
|
|
|
#include "Implementation/PerformImplementation.hpp"
|
|
|
|
|
2022-04-28 19:35:40 +00:00
|
|
|
#endif /* InstructionSets_M68k_Perform_h */
|