forked from jurem/SicTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfig2.10.asm
54 lines (54 loc) · 1.09 KB
/
fig2.10.asm
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
46
47
48
49
50
51
52
53
54
. changed: device number 05 to 01
COPY START 0
FIRST STL RETADR
LDB #LENGTH
BASE LENGTH
CLOOP +JSUB RDREC
LDA LENGTH
COMP #0
JEQ ENDFIL
+JSUB WRREC
J CLOOP
ENDFIL LDA =C'EOF'
STA BUFFER
LDA #3
STA LENGTH
+JSUB WRREC
J @RETADR
LTORG
RETADR RESW 1
LENGTH RESW 1
BUFFER RESB 4096
BUFFEND EQU *
MAXLEN EQU BUFFEND-BUFFER
.
. Subroutine to read record into buffer
.
RDREC CLEAR X
CLEAR A
CLEAR S
+LDT #MAXLEN
RLOOP TD =X'F1'
JEQ RLOOP
RD =X'F1'
COMPR A,S
JEQ EXIT
STCH BUFFER,X
TIXR T
JLT RLOOP
EXIT STX LENGTH
RSUB
LTORG
.
. Subroutine to write record from buffer
.
WRREC CLEAR X
LDT LENGTH
WLOOP TD =X'01'
JEQ WLOOP
LDCH BUFFER,X
WD =X'01'
TIXR T
JLT WLOOP
RSUB
END FIRST