ram, instr reel, runtime, etc

This commit is contained in:
2026-03-20 16:53:02 -06:00
parent 16fa0bf3ea
commit 5a4eb66c78
12 changed files with 390 additions and 20 deletions

View File

@@ -0,0 +1,59 @@
#pragma once
#include <spider/SpiderRuntime.hpp>
namespace spider {
/**
* Implements an instruction reel.
*/
class InstrReel {
private:
public:
InstrReel();
~InstrReel();
public:
public:
/**
* Returns the two-byte instruction at the
* specific byte location.
*/
u16 instrAt(u64 ip) const;
/**
* Obtains a byte of data at
* the specific location.
*/
u8 dataAt(u64 ip) const;
public:
/**
* Fetches the data, and then
* feeds the instruction into the
* CPU.
*
* Returns how many steps it should
* move after.
*/
u8 feedNext(CPU& cpu);
public: // Static Utils //
static u16 unpackInstr(u16 bcode);
static u8 unpackAddrMode(u16 bcode);
static u8 unpackTypeSize(u16 bcode);
};
}