summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
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
+