From 8b20b35bf5506ff74b7337e35d6827064eace425 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sat, 7 Dec 2019 12:21:35 -0500 Subject: Added six instructions for transfering data between the three main registers. These instructions are: TAY: Transfer Accumulator to Y. TAX: Transfer Accumulator to X. TYX: Transfer Y to X. TYA: Transfer Y to Accumulator. TXA: Transfer X to Accumulator. TXY: Transfer X to Y. --- opcode.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'opcode.h') diff --git a/opcode.h b/opcode.h index 1f84763..ae637d4 100644 --- a/opcode.h +++ b/opcode.h @@ -9,13 +9,19 @@ #define PHP 0x08 /* PusH Processor status to stack. */ #define PHA 0x09 /* PusH Accumulator to stack. */ #define PHY 0x0A /* PusH Y register to stack. */ +#define TAY 0x0B /* Transfer Accumulator to Y. */ #define PHX 0x0C /* PusH X register to stack. */ +#define TAX 0x0D /* Transfer Accumulator to X. */ +#define TYX 0x0E /* Transfer Y to X. */ #define JMP 0x10 /* JuMP to memory location. */ #define SBC 0x11 /* SuBtract with Carry. */ #define PLP 0x18 /* PuLl Processor status from stack. */ #define PLA 0x19 /* PuLl Accumulator from stack. */ #define PLY 0x1A /* PuLl Y register from stack. */ +#define TYA 0x1B /* Transfer Y to Accumulator. */ #define PLX 0x1C /* PuLl X register from stack. */ +#define TXA 0x1D /* Transfer X to Accumulator. */ +#define TXY 0x1E /* Transfer X to Y. */ #define JSR 0x20 /* Jump to SubRoutine. */ #define AND 0x21 /* bitwise AND with accumulator. */ #define ANY 0x22 /* bitwise ANd with Y register.*/ @@ -126,7 +132,10 @@ static const char *opname[0x100] = { OPNAME(PHP), OPNAME(PHA), OPNAME(PHY), + OPNAME(TAY), OPNAME(PHX), + OPNAME(TAX), + OPNAME(TYX), OPNAME(JMP), [SBC] = "SBC #", [0x13] = "SBC a", @@ -134,7 +143,10 @@ static const char *opname[0x100] = { OPNAME(PLP), OPNAME(PLA), OPNAME(PLY), + OPNAME(TYA), OPNAME(PLX), + OPNAME(TXA), + OPNAME(TXY), OPNAME(JSR), [AND] = "AND #", [ANY] = "ANY #", -- cgit v1.2.3-13-gbd6f