Adding the LDA

This commit is contained in:
AnonymusRaccoon
2020-02-13 15:50:14 +01:00
parent 8cc87d0be2
commit 7e97a9466c
4 changed files with 125 additions and 2 deletions
@@ -42,4 +42,17 @@ namespace ComSquare::CPU
if (!this->_registers.p.m)
this->_bus->write(addr + 1, 0x00);
}
void CPU::LDA(uint24_t addr)
{
if (this->_registers.p.m) {
this->_registers.a = this->_bus->read(addr);
this->_registers.p.n = this->_registers.al & 0xF0u;
} else {
this->_registers.al = this->_bus->read(addr);
this->_registers.ah = this->_bus->read(addr + 1);
this->_registers.p.n = this->_registers.a & 0xF000u;
}
this->_registers.p.z = this->_registers.a == 0x0;
}
}