Add TYA instruction
This commit is contained in:
parent
99be8b1568
commit
f830fc4ea0
|
@ -31,6 +31,7 @@ typedef unsigned short word; // 16 bit
|
|||
#define INS_TSX 0xBA // TSX Implied
|
||||
#define INS_TXA 0x8A // TXA Implied
|
||||
#define INS_TXS 0x9A // TXS Implied
|
||||
#define INS_TYA 0x98 // TYA Implied
|
||||
|
||||
#define INS_JSR 0x20 // JSR
|
||||
#define INS_RTS 0x60 // RTS
|
||||
|
|
|
@ -157,6 +157,14 @@ void execute() {
|
|||
cpu.SP = cpu.X;
|
||||
cpu.PC++;
|
||||
break;
|
||||
case INS_TYA:
|
||||
cpu.A = cpu.Y;
|
||||
cpu.Z = (cpu.A == 0);
|
||||
cpu.N = (cpu.A & 0b1000000) > 0;
|
||||
cpu.PC++;
|
||||
break;
|
||||
|
||||
|
||||
case INS_JSR:
|
||||
word jsr_addr = fetch_word();
|
||||
write_word(cpu.PC - 1, cpu.SP);
|
||||
|
|
|
@ -1 +1 @@
|
|||
<EFBFBD>B<EFBFBD>
|
||||
<EFBFBD>S<EFBFBD>
|
Loading…
Reference in New Issue