ready for addrm & instr
This commit is contained in:
@@ -4,17 +4,33 @@ namespace spider {
|
||||
|
||||
// Constructors & Destructors //
|
||||
|
||||
Runtime::Runtime() : ram(0) {}
|
||||
Runtime::Runtime() : Runtime(0) {}
|
||||
|
||||
Runtime::Runtime(u64 ramSize) : ram(ramSize) {}
|
||||
Runtime::Runtime(u64 ramSize) : ram(ramSize), reel(nullptr) {
|
||||
cpu.hookRAM(&ram);
|
||||
}
|
||||
|
||||
Runtime::~Runtime() {}
|
||||
Runtime::~Runtime() {
|
||||
delete reel;
|
||||
}
|
||||
|
||||
// Stepping/Running the Machine //
|
||||
|
||||
void Runtime::step() {}
|
||||
void Runtime::step() {
|
||||
cpu.fetchInstr();
|
||||
// TODO: Call instruction
|
||||
}
|
||||
|
||||
void Runtime::step(u64 n) {}
|
||||
void Runtime::step(u64 n) {
|
||||
while(n >= 4) {
|
||||
step();
|
||||
step();
|
||||
step();
|
||||
step();
|
||||
n -= 4;
|
||||
}
|
||||
while (n--) step();
|
||||
}
|
||||
|
||||
void Runtime::run() {}
|
||||
|
||||
@@ -26,4 +42,12 @@ namespace spider {
|
||||
ram.resize(length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Non-owning reel setup.
|
||||
*/
|
||||
void Runtime::hookReel(InstrReel* reel, bool own) {
|
||||
cpu.hookInstrReel(reel);
|
||||
if(own) this->reel = reel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user