aboutsummaryrefslogtreecommitdiff
path: root/build/assembly
blob: 196c19d57fe0fff753fdb524e9e3a59932258e04 (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
COPY	START	1000
FIRST	STL	RETADR
CLOOP	JSUB	RDREC
	LDA	LENGTH
	COMP	ZERO
	JEQ	ENDFIL
	JSUB	WRREC
	J	CLOOP
ENDFIL	LDA	EOF
	STA	BUFFER
	LDA	THREE
	STA	LENGTH
	JSUB	WRREC
	LDL	RETADR
	RSUB
EOF	BYTE	C'EOF'
THREE	WORD	3
ZERO	WORD	0
RETADR	RESW	1
LENGTH	RESW	1
BUFFER	RESB	4096
RDREC	LDX	ZERO
	LDA	ZERO
RLOOP	TD	INPUT
	JEQ	RLOOP
	RD	INPUT
	COMP	ZERO
	JEQ	EXIT
	STCH	BUFFER,X
	TIX	MAXLEN
	JLT	RLOOP
EXIT	STX	LENGTH
	RSUB
INPUT	BYTE	X'F1'
MAXLEN	WORD	4096
WRREC	LDX	ZERO
WLOOP	TD	OUTPUT
	JEQ	WLOOP
	LDCH	BUFFER,X
	WD	OUTPUT
	TIX	LENGTH
	JLT	WLOOP
	RSUB
OUTPUT	BYTE	X'05'
	END	FIRST