add a basic structure for disassembler + executor

Instructions added
Branch and Exchange (BX)
Branch and Link (B)
Multiply and Accumulate (MUL, MLA)
Multiply Long and Accumulate (SMULL, SMLAL, UMULL, UMLAL)
Single data swap (SWP)
[WIP] Halfword Transfer (STRH, LDRH)

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2023-09-13 03:44:36 +05:30
parent 904e2b698e
commit 8a04eade92
22 changed files with 571 additions and 50 deletions

View File

@@ -1,6 +1,5 @@
#pragma once
#include "util/bits.hh"
#include "utility.hh"
#include <cstdint>
@@ -14,7 +13,7 @@ class Psr {
void set_mode(Mode mode);
// State : [5]
bool state() const;
State state() const;
void set_state(State state);
#define GET_SET_NTH_BIT_FUNCTIONS(name) \
@@ -43,6 +42,8 @@ class Psr {
#undef GET_SET_NTH_BIT_FUNCTIONS
bool condition(Condition cond) const;
private:
static constexpr uint32_t PSR_CLEAR_RESERVED = 0xf00000ff;
static constexpr uint32_t PSR_CLEAR_MODE = 0x0b00000;