Merge main and resolve conflicts

This commit is contained in:
Diego De Gante Pérez
2026-04-06 13:41:49 -06:00
7 changed files with 250 additions and 57 deletions

View File

@@ -80,7 +80,7 @@ namespace spider {
_opers[1] = _opers[0];
// call specific addressing mode
(this->*(CPU::addrModes[_addrm]))();
(this->*(CPU::addrModes[_addrm & 0b111]))(); // mask added here too
}
void CPU::fetchOperSrc() {
@@ -88,21 +88,19 @@ namespace spider {
_alu = &ALU1;
// call specific addressing mode
(this->*(CPU::addrModes[_addrm]))();
(this->*(CPU::addrModes[_addrm & 0b111]))(); // mask keeps index within 0-7
// modify the _addrm register
_addrm = static_cast<u8>((_addrm >> 3) & 0x1F);
_addrm++;
}
/**
instrMap[] is the correct 512-entry dispatch
table that maps operation codes to instruction methods.
*/
void CPU::execute() {
(this->*(CPU::instrMap[_opcode]))();
(this->*(CPU::instrMap[_opcode]))(); // no null check needed
}
// Addressing Modes //
/**
@@ -149,6 +147,7 @@ namespace spider {
// get byte
u8 reg = (_reel->readU8(RI) >> sh) & 0xF;
_alu = &GPR[reg];
_opers[0] = _alu; // explicitly sets _opers[0] = _dst
RI += use;
// store no-op