2023-10-05 15:23:41 +00:00
|
|
|
//
|
|
|
|
// Perform.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 05/10/2023.
|
|
|
|
// Copyright © 2023 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Perform_h
|
|
|
|
#define Perform_h
|
|
|
|
|
|
|
|
#include "Instruction.hpp"
|
2023-10-05 18:37:58 +00:00
|
|
|
#include "Model.hpp"
|
|
|
|
#include "Status.hpp"
|
|
|
|
#include "../../Numeric/RegisterSizes.hpp"
|
2023-10-05 15:23:41 +00:00
|
|
|
|
|
|
|
namespace InstructionSet::x86 {
|
|
|
|
|
|
|
|
/// Performs @c instruction using @c resolver to obtain to query @c registers and/or @c memory as required, using @c io for port input/output,
|
|
|
|
/// and providing any flow control effects to @c flow_controller.
|
|
|
|
///
|
|
|
|
/// Any change in processor status will be applied to @c status.
|
|
|
|
///
|
|
|
|
/// If the template parameter @c operation is not @c Operation::Undefined then that operation will be performed, ignoring
|
|
|
|
/// whatever is specifed in @c instruction.
|
|
|
|
template <
|
|
|
|
Model model,
|
2023-10-05 18:37:58 +00:00
|
|
|
typename InstructionT,
|
2023-10-05 15:23:41 +00:00
|
|
|
typename FlowControllerT,
|
|
|
|
typename DataPointerResolverT,
|
|
|
|
typename RegistersT,
|
|
|
|
typename MemoryT,
|
|
|
|
typename IOT,
|
2023-10-05 18:37:58 +00:00
|
|
|
Operation operation = Operation::Invalid
|
2023-10-05 15:23:41 +00:00
|
|
|
> void perform(
|
2023-10-05 18:37:58 +00:00
|
|
|
const InstructionT &instruction,
|
2023-10-05 15:23:41 +00:00
|
|
|
Status &status,
|
|
|
|
FlowControllerT &flow_controller,
|
|
|
|
DataPointerResolverT &resolver,
|
|
|
|
RegistersT ®isters,
|
|
|
|
MemoryT &memory,
|
|
|
|
IOT &io
|
|
|
|
);
|
|
|
|
|
2023-10-05 18:37:58 +00:00
|
|
|
template <
|
|
|
|
Model model,
|
|
|
|
Operation operation,
|
|
|
|
DataSize data_size,
|
|
|
|
typename FlowControllerT
|
|
|
|
> void perform(
|
|
|
|
CPU::RegisterPair32 &destination,
|
|
|
|
CPU::RegisterPair32 &source,
|
|
|
|
Status &status,
|
|
|
|
FlowControllerT &flow_controller
|
|
|
|
);
|
|
|
|
|
|
|
|
template <
|
|
|
|
Model model,
|
|
|
|
Operation operation,
|
|
|
|
DataSize data_size,
|
|
|
|
typename FlowControllerT
|
|
|
|
> void perform(
|
|
|
|
CPU::RegisterPair16 &destination,
|
|
|
|
CPU::RegisterPair16 &source,
|
|
|
|
Status &status,
|
|
|
|
FlowControllerT &flow_controller
|
|
|
|
);
|
|
|
|
|
2023-10-05 15:23:41 +00:00
|
|
|
}
|
|
|
|
|
2023-10-05 18:37:58 +00:00
|
|
|
#include "Implementation/PerformImplementation.hpp"
|
|
|
|
|
2023-10-05 15:23:41 +00:00
|
|
|
#endif /* Perform_h */
|