summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-03-17 15:07:20 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-03-17 15:36:07 -0400
commit071edf621a6722f94027f37720a5a5f73d9696c0 (patch)
tree87761e6dca9e7cf47bf0b6f2d52e8e31623ac01a /test
parent917f864a6d1304d9f0c650c107a5fd6576690cb7 (diff)
Revamped the opcode table, made the emulator more
efficient, and ported SuBEditor to C. I revamped the opcode table to add another prefix bit for the addressing mode, finally giving access to all addresses, without wasting any bytes. I made the stack based operations more efficient, by sort of applying Duff's device to it. And I ported SuBEditor to C, to make it easier for me to figure out how to implement SuBAsm.
Diffstat (limited to 'test')
-rw-r--r--test/subroutine.s45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/subroutine.s b/test/subroutine.s
new file mode 100644
index 0000000..03447fd
--- /dev/null
+++ b/test/subroutine.s
@@ -0,0 +1,45 @@
+.org $2000
+buf:
+
+.org $0
+ptr:
+.qword buf
+
+.org $8000
+reset:
+ cps
+ ldx.w #$FFFF
+ txs
+start:
+ ldy #0
+ ldb #0
+ inb
+ stb $C010
+ deb
+ jsl clr_buf
+ jmp start
+
+clr_buf:
+ lda #0
+ cpy.w #$1FFF
+ bcs clr_buf_end
+ sta.q (ptr), y
+ tya
+ adc #8
+ tay
+ tba
+ sta.q (ptr), y
+ tya
+ adc #8
+ tay
+ tba
+ jmp clr_buf
+clr_buf_end:
+ ldy.w #0
+ rtl
+
+
+.org $FFC0
+.qword reset
+done
+