internal/vm/{exec_funcs,opcodes}: add support for executing INX

This commit is contained in:
Bradford Lamson-Scribner 2020-05-31 08:59:09 -06:00
parent 35bdeac2c8
commit 00cec5678e
2 changed files with 12 additions and 2 deletions

View File

@ -69,3 +69,13 @@ func execINX(a *Appleone, o op) error {
a.setNegativeIfOverflow(b)
return nil
}
// Y + 1 -> Y N Z C I D V
// + + - - - -
func execINY(a *Appleone, o op) error {
b := a.cpu.y + 1
a.cpu.y = b
a.setZeroIfNeeded(b)
a.setNegativeIfOverflow(b)
return nil
}

View File

@ -113,13 +113,13 @@ var opcodes = map[uint8]op{
// addressing assembler opc bytes cyles
// --------------------------------------------
// implied INX E8 1 2
0xE8: newOp("INX", 0xE8, 1, implied, todo),
0xE8: newOp("INX", 0xE8, 1, implied, execINX),
// INY Increment Index Y by One
// addressing assembler opc bytes cyles
// --------------------------------------------
// implied INY C8 1 2
0xC8: newOp("INY", 0xC8, 1, implied, todo),
0xC8: newOp("INY", 0xC8, 1, implied, execINY),
// TAX Transfer Accumulator to Index X
// addressing assembler opc bytes cyles