Add TAX instruction
This commit is contained in:
parent
ab23f2f98f
commit
c21fdeb552
|
@ -26,6 +26,9 @@ typedef unsigned short word; // 16 bit
|
|||
#define INS_LDY_ABS 0xAC // LDY Absolute
|
||||
#define INS_LDY_ABSX 0xBC // LDY Absolute,X
|
||||
|
||||
#define INS_TAX 0xAA // TAX Implied
|
||||
#define INS_TAY 0xA8 // TAY Implied
|
||||
|
||||
#define INS_JSR 0x20 // JSR
|
||||
#define INS_RTS 0x60 // RTS
|
||||
|
||||
|
|
|
@ -127,7 +127,12 @@ void execute() {
|
|||
cpu.Z = (cpu.Y == 0);
|
||||
cpu.N = (cpu.Y & 0b1000000) > 0;
|
||||
break;
|
||||
|
||||
case INS_TAX:
|
||||
cpu.X = cpu.A;
|
||||
cpu.Z = (cpu.X == 0);
|
||||
cpu.N = (cpu.X & 0b1000000) > 0;
|
||||
cpu.PC++;
|
||||
break;
|
||||
case INS_JSR:
|
||||
word jsr_addr = fetch_word();
|
||||
write_word(cpu.PC - 1, cpu.SP);
|
||||
|
|
|
@ -1 +1 @@
|
|||
ゥVゥdゥB
|
||||
ゥUェ
|
Loading…
Reference in New Issue