-
Notifications
You must be signed in to change notification settings - Fork 0
/
input1.txt
47 lines (47 loc) · 984 Bytes
/
input1.txt
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
COPY START 0000
FIRST STL RETADR
LDB #LENGTH
BASE LENGTH
CLOOP +JSUB RDREC
LDA LENGTH
COMP #0
JEQ ENDFIL
+JSUB WRREC
J CLOOP
ENDFIL LDA =C’EOF’
LDA =C'EOF'
STA BUFFER
LDA #3
STA LENGTH
+JSUB WRREC
J @RETADR
RETADR RESW 1
LENGTH RESW 1
BUFFER RESB 4096
BUFEND EQU *
MAXLEN EQU BUFEND
RDREC CLEAR X
CLEAR A
CLEAR S
+LDT #MAXLEN
RLOOP TD INPUT
JEQ RLOOP
RD INPUT
COMPR A,S
JEQ EXIT
STCH BUFFER,X
TIXR T
JLT RLOOP
EXIT STX LENGTH
RSUB
INPUT BYTE X’F1’
WRREC CLEAR X
LDT LENGTH
WLOOP TD =X’05’
JEQ WLOOP
LDCH BUFFER,X
WD =X’05’
TIXR T
JLT WLOOP
RSUB
END FIRST