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. --- test/reg-transfer.s | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/reg-transfer.s (limited to 'test') 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 + +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 + -- cgit v1.2.3-13-gbd6f