Add INX and INY instructions
This commit is contained in:
parent
f830fc4ea0
commit
8607e93b3e
|
@ -38,6 +38,9 @@ typedef unsigned short word; // 16 bit
|
|||
|
||||
#define INS_NOP 0xEA // NOP
|
||||
|
||||
#define INS_INX 0xE8 // INX Implied
|
||||
#define INS_INY 0xC8 // INY Implied
|
||||
|
||||
struct MEMORY {
|
||||
byte memory[MAX_MEMORY];
|
||||
};
|
||||
|
|
|
@ -162,8 +162,7 @@ void execute() {
|
|||
cpu.Z = (cpu.A == 0);
|
||||
cpu.N = (cpu.A & 0b1000000) > 0;
|
||||
cpu.PC++;
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
case INS_JSR:
|
||||
word jsr_addr = fetch_word();
|
||||
|
@ -176,6 +175,16 @@ void execute() {
|
|||
break;
|
||||
case INS_NOP:
|
||||
break;
|
||||
case INS_INX:
|
||||
cpu.X++;
|
||||
cpu.Z = (cpu.X == 0);
|
||||
cpu.N = (cpu.X & 0b1000000) > 0;
|
||||
break;
|
||||
case INS_INY:
|
||||
cpu.Y++;
|
||||
cpu.Z = (cpu.Y == 0);
|
||||
cpu.N = (cpu.Y & 0b1000000) > 0;
|
||||
break;
|
||||
case 0x00: // EOF
|
||||
return;
|
||||
default:
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue