Adding the program counter relative addressing mode

This commit is contained in:
AnonymusRaccoon
2020-02-11 11:45:22 +01:00
parent 3f45f99991
commit 7d51bc623e
3 changed files with 27 additions and 0 deletions
+7
View File
@@ -318,4 +318,11 @@ namespace ComSquare::CPU
lng += this->_bus->read(this->_registers.pac++) << 16u;
return lng + this->_registers.x;
}
uint24_t CPU::_getProgramCounterRelativeAddr()
{
uint24_t pc = this->_registers.pac;
int8_t mod = this->_bus->read(this->_registers.pac++);
return pc + mod;
}
}