summaryrefslogtreecommitdiff
path: root/opcode.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2019-12-07 12:21:35 -0500
committermrb0nk500 <b0nk@b0nk.xyz>2019-12-07 12:21:35 -0500
commit8b20b35bf5506ff74b7337e35d6827064eace425 (patch)
tree70d52e2f59057a6d2d93aaa7d287031afc0973dc /opcode.h
parent8d0f46d4e62af5d66ff3cce872256163a41b54bf (diff)
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.
Diffstat (limited to 'opcode.h')
-rw-r--r--opcode.h12
1 files changed, 12 insertions, 0 deletions
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 #",