summaryrefslogtreecommitdiff
path: root/test/subroutine.s
blob: 03447fd7da81d2afe994eed486add4ce917e7480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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