-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewinput.txt
63 lines (63 loc) · 970 Bytes
/
newinput.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
. This is a sample program only for the purpose of testing
. It tests almost all features of SIC/XE program
COPY START 0
FIRST STL RETADR
LDB #LENGTH
BASE LENGTH
CLOOP +JSUB RDREC
LDA LENGTH
COMP #0
JEQ ENDFIL
+JSUB WRREC
ABC LDB =X'07'
LDA =C'DF'
J CLOOP
ENDFIL LDA EOF
STA BUFFER
LDA #3
STA LENGTH
+JSUB WRREC
J @RETADR
LTORG
EOF BYTE C'EOF'
RETADR RESW 1
LENGTH RESW 1
BUFFER RESB 4096
BUFEND EQU *
MAXLEN EQU BUFEND-BUFFER
VALUE EQU MAXLEN+200
.
. SUBROUTINE TO READ RECORD FROM BUFFER
.
RDREC CLEAR X
CLEAR A
CLEAR S
+LDT #MAXLEN
RLOOP TD INPUT
JEQ RLOOP
RD INPUT
COMPR A,S
LDA =C'FKF'
JEQ EXIT
STCH BUFFER,X
TIXR T
JLT RLOOP
EXIT STX LENGTH
RSUB
INPUT BYTE X'F1'
.
. subroutinE TO WRITE RECORDS FROM BUFFER
.
WRREC CLEAR X
LDT LENGTH
WLOOP TD OUTPUT
JEQ WLOOP
LDCH BUFFER,X
WD OUTPUT
TIXR T
LDA =C'ADD'
LDB =C'ADD'
JLT WLOOP
RSUB
OUTPUT BYTE X'05'
END FIRST