mirror of
https://github.com/bradford-hamilton/apple-1.git
synced 2024-06-01 05:41:30 +00:00
internal/vm/{exec_funcs,opcodes}: add support for executing INX
This commit is contained in:
parent
35bdeac2c8
commit
00cec5678e
|
@ -69,3 +69,13 @@ func execINX(a *Appleone, o op) error {
|
||||||
a.setNegativeIfOverflow(b)
|
a.setNegativeIfOverflow(b)
|
||||||
return nil
|
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
|
||||||
|
}
|
||||||
|
|
|
@ -113,13 +113,13 @@ var opcodes = map[uint8]op{
|
||||||
// addressing assembler opc bytes cyles
|
// addressing assembler opc bytes cyles
|
||||||
// --------------------------------------------
|
// --------------------------------------------
|
||||||
// implied INX E8 1 2
|
// 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
|
// INY Increment Index Y by One
|
||||||
// addressing assembler opc bytes cyles
|
// addressing assembler opc bytes cyles
|
||||||
// --------------------------------------------
|
// --------------------------------------------
|
||||||
// implied INY C8 1 2
|
// 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
|
// TAX Transfer Accumulator to Index X
|
||||||
// addressing assembler opc bytes cyles
|
// addressing assembler opc bytes cyles
|
||||||
|
|
Loading…
Reference in New Issue
Block a user