1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-11 04:28:58 +00:00
CLK/InstructionSets/ARM/Instruction.hpp
2024-02-21 14:18:41 -05:00

41 lines
850 B
C++

//
// Instruction.hpp
// Clock Signal
//
// Created by Thomas Harte on 16/02/2024.
// Copyright © 2024 Thomas Harte. All rights reserved.
//
#pragma once
#include "Decoder.hpp"
#include "Model.hpp"
#include "Operation.hpp"
namespace InstructionSet::ARM {
/*
//
// LDR and STR.
//
struct SingleDataTransfer {
constexpr SingleDataTransfer(uint32_t opcode) noexcept : opcode_(opcode) {}
/// The destination register index. i.e. 'Rd' for LDR.
int destination() const { return (opcode_ >> 12) & 0xf; }
/// The destination register index. i.e. 'Rd' for STR.
int source() const { return (opcode_ >> 12) & 0xf; }
/// The base register index. i.e. 'Rn'.
int base() const { return (opcode_ >> 16) & 0xf; }
///
int offset() const { return opcode_ & 0xfff; }
// TODO: P, U, B, W, L, I.
*/
}