-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathcode1
162 lines (162 loc) · 1.81 KB
/
code1
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
;*****CODE1*****
OMERR LDX #ERROM
.SKI 3
ERROR LSR CNTWFL
LDA CHANNL
BEQ ERRCRD
JSR CLSCHN
LDA #0
STA CHANNL
ERRCRD JSR CRDO
JSR OUTQST
GETERR LDA ERRTAB,X
PHA
AND #127
JSR OUTDO
INX
PLA
BPL GETERR
TYPERR JSR STKINI
LDA #<ERR
LDY #>ERR
ERRFIN JSR STROUT
LDY CURLIN+1
INY
BEQ READY
JSR INPRT
.SKI 3
READY LSR CNTWFL
LDA #<REDDY
LDY #>REDDY
JSR STROUT
.SKI 3
MAIN JSR INLIN
STX TXTPTR
STY TXTPTR+1
JSR CHRGET
BEQ MAIN
LDX #255
STX CURLIN+1
BCC MAIN1
JSR CRUNCH
JMP GONE
MAIN1 JSR LINGET
JSR CRUNCH
STY COUNT
JSR FNDLIN
BCC NODEL
LDY #1
LDA (LOWTR)Y
STA INDEX1+1
LDA VARTAB
STA INDEX1
LDA LOWTR+1
STA INDEX2+1
LDA LOWTR
DEY
SBC (LOWTR)Y
CLC
ADC VARTAB
STA VARTAB
STA INDEX2
LDA VARTAB+1
ADC #255
STA VARTAB+1
SBC LOWTR+1
TAX
SEC
LDA LOWTR
SBC VARTAB
TAY
BCS QDECT1
INX
DEC INDEX2+1
QDECT1 CLC
ADC INDEX1
BCC MLOOP
DEC INDEX1+1
CLC
MLOOP LDA (INDEX1)Y
STA (INDEX2)Y
INY
BNE MLOOP
INC INDEX1+1
INC INDEX2+1
DEX
BNE MLOOP
NODEL LDA BUF
BEQ FINI
LDA MEMSIZ
LDY MEMSIZ+1
STA FRETOP
STY FRETOP+1
LDA VARTAB
STA HIGHTR
ADC COUNT
STA HIGHDS
LDY VARTAB+1
STY HIGHTR+1
BCC NODELC
INY
NODELC STY HIGHDS+1
JSR BLTU
LDA STREND
LDY STREND+1
STA VARTAB
STY VARTAB+1
LDY COUNT
DEY
STOLOP LDA BUF-4,Y
STA (LOWTR)Y
DEY
BPL STOLOP
FINI JSR RUNC
LNKPRG LDA TXTTAB
LDY TXTTAB+1
STA INDEX
STY INDEX+1
CLC
CHEAD LDY #1
LDA (INDEX)Y
BNE *+5
JMP MAIN
LDY #4
CZLOOP INY
LDA (INDEX)Y
BNE CZLOOP
INY
TYA
ADC INDEX
TAX
LDY #0
STA (INDEX)Y
LDA INDEX+1
ADC #0
INY
STA (INDEX)Y
STX INDEX
STA INDEX+1
BCC CHEAD
LINLIN DEX
BPL INLINC
INLINN JSR CRDO
INLIN LDX #0
INLINC JSR INCHR
CMP #13
BEQ FININ1
STA BUF,X
INX
BNE INLINC
FININ1 JMP FININL
INCHR JSR CINCH
LDY CHANNL
BNE INCRTS
CMP #$0F
BNE INCRTS
PHA
LDA CNTWFL
EOR #$FF
STA CNTWFL
PLA
INCRTS RTS
.FIL CODE2