summaryrefslogtreecommitdiff
path: root/test
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 /test
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 'test')
-rw-r--r--test/reg-transfer.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/reg-transfer.s b/test/reg-transfer.s
new file mode 100644
index 0000000..580020c
--- /dev/null
+++ b/test/reg-transfer.s
@@ -0,0 +1,23 @@
+; Test register transfer instructions.
+;
+; by mr b0nk 500 <b0nk @b0nk.xyz>
+
+cps
+inc ; Increment the accumulator.
+tay ; Transfer the accumulator to the y register.
+tax ; Do the same thing, but with the x register.
+jmp $1 ; Loop forever.
+
+.org $8000
+cps
+inc ; Increment the accumulator.
+tay ; Transfer the accumulator to the y register.
+tax ; Do the same thing, but with the x register.
+jmp $1 ; Loop forever.
+
+.org $FF50
+.qword $8000
+
+; Execute the program.
+done
+