mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-09 12:51:01 +00:00
Finishing to implements JSR/JLR and push
This commit is contained in:
@@ -19,4 +19,90 @@ namespace ComSquare::CPU
|
||||
this->_registers.p.m = true;
|
||||
}
|
||||
}
|
||||
|
||||
void CPU::JSR(uint24_t valueAddr)
|
||||
{
|
||||
this->_push(--this->_registers.pc);
|
||||
this->_registers.pc = this->_bus->read(valueAddr) + (this->_bus->read(valueAddr + 1) << 8u);
|
||||
}
|
||||
|
||||
void CPU::JSL(uint24_t valueAddr)
|
||||
{
|
||||
this->_registers.pac--;
|
||||
this->_push(this->_registers.pbr);
|
||||
this->_push(this->_registers.pc);
|
||||
this->_registers.pc = this->_bus->read(valueAddr) + (this->_bus->read(valueAddr + 1) << 8u);
|
||||
}
|
||||
|
||||
void CPU::PHA()
|
||||
{
|
||||
this->_push(this->_registers.a);
|
||||
}
|
||||
|
||||
void CPU::PHB()
|
||||
{
|
||||
this->_push(this->_registers.dbr);
|
||||
}
|
||||
|
||||
void CPU::PHD()
|
||||
{
|
||||
this->_push(this->_registers.d);
|
||||
}
|
||||
|
||||
void CPU::PHK()
|
||||
{
|
||||
this->_push(this->_registers.pbr);
|
||||
}
|
||||
|
||||
void CPU::PHP()
|
||||
{
|
||||
this->_push(this->_registers.p.flags);
|
||||
}
|
||||
|
||||
void CPU::PHX()
|
||||
{
|
||||
this->_push(this->_registers.x);
|
||||
}
|
||||
|
||||
void CPU::PHY()
|
||||
{
|
||||
this->_push(this->_registers.y);
|
||||
}
|
||||
|
||||
void CPU::PLA()
|
||||
{
|
||||
this->_registers.a = this->_pop16();
|
||||
this->_registers.p.z = this->_registers.a == 0;
|
||||
this->_registers.p.n = this->_registers.a & 0x8000u;
|
||||
}
|
||||
|
||||
void CPU::PLB()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CPU::PLD()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CPU::PLK()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CPU::PLP()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CPU::PLX()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CPU::PLY()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user