-
Notifications
You must be signed in to change notification settings - Fork 85
/
code14
208 lines (208 loc) · 2.35 KB
/
code14
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
.PAG 'CODE14'
PHA
LDA TXTPTR
PHA
JSR DATA
JMP DEFFIN
GETFNM LDA #FNTK
JSR SYNCHR
ORA #128
STA SUBFLG
JSR PTRGT2
STA DEFPNT
STY DEFPNT+1
JMP CHKNUM
FNDOER JSR GETFNM
LDA DEFPNT+1
PHA
LDA DEFPNT
PHA
JSR PARCHK
JSR CHKNUM
PLA
STA DEFPNT
PLA
STA DEFPNT+1
LDY #2
LDA (DEFPNT)Y
STA VARPNT
TAX
INY
LDA (DEFPNT)Y
BEQ ERRGUF
STA VARPNT+1
INY
DEFSTF LDA (VARPNT)Y
PHA
DEY
BPL DEFSTF
LDY VARPNT+1
JSR MOVMF
LDA TXTPTR+1
PHA
LDA TXTPTR
PHA
LDA (DEFPNT)Y
STA TXTPTR
INY
LDA (DEFPNT)Y
STA TXTPTR+1
LDA VARPNT+1
PHA
LDA VARPNT
PHA
JSR FRMNUM
PLA
STA DEFPNT
PLA
STA DEFPNT+1
JSR CHRGOT
BEQ *+5
JMP SNERR
PLA
STA TXTPTR
PLA
STA TXTPTR+1
DEFFIN LDY #0
PLA
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
PLA
INY
STA (DEFPNT)Y
RTS
STRD JSR CHKNUM
LDY #0
JSR FOUTC
PLA
PLA
TIMSTR LDA #<LOFBUF
LDY #>LOFBUF
BEQ STRLIT
STRINI LDX FACMO
LDY FACMO+1
STX DSCPNT
STY DSCPNT+1
STRSPA JSR GETSPA
STX DSCTMP+1
STY DSCTMP+2
STA DSCTMP
RTS
STRLIT LDX #34
STX CHARAC
STX ENDCHR
STRLT2 STA STRNG1
STY STRNG1+1
STA DSCTMP+1
STY DSCTMP+2
LDY #255
STRGET INY
LDA (STRNG1)Y
BEQ STRFI1
CMP CHARAC
BEQ STRFIN
CMP ENDCHR
BNE STRGET
STRFIN CMP #34
BEQ STRFI2
STRFI1 CLC
STRFI2 STY DSCTMP
TYA
ADC STRNG1
STA STRNG2
LDX STRNG1+1
BCC STRST2
INX
STRST2 STX STRNG2+1
LDA STRNG1+1
BEQ STRCP
CMP #BUFPAG
BNE PUTNEW
STRCP TYA
JSR STRINI
LDX STRNG1
LDY STRNG1+1
JSR MOVSTR
PUTNEW LDX TEMPPT
CPX #TEMPST+STRSIZ+STRSIZ+STRSIZ
BNE PUTNW1
LDX #ERRST
ERRGO2 JMP ERROR
PUTNW1 LDA DSCTMP
STA 0,X
LDA DSCTMP+1
STA 1,X
LDA DSCTMP+2
STA 2,X
LDY #0
STX FACMO
STY FACMO+1
STY FACOV
DEY
STY VALTYP
STX LASTPT
INX
INX
INX
STX TEMPPT
RTS
GETSPA LSR GARBFL
TRYAG2 PHA
EOR #255
SEC
ADC FRETOP
LDY FRETOP+1
BCS TRYAG3
DEY
TRYAG3 CPY STREND+1
BCC GARBAG
BNE STRFRE
CMP STREND
BCC GARBAG
STRFRE STA FRETOP
STY FRETOP+1
STA FRESPC
STY FRESPC+1
TAX
PLA
RTS
GARBAG LDX #ERROM ;OUT OF MEMORY
LDA GARBFL
BMI ERRGO2
JSR GARBA2
LDA #128
STA GARBFL
PLA
BNE TRYAG2
GARBA2 LDX MEMSIZ
LDA MEMSIZ+1
FNDVAR STX FRETOP
STA FRETOP+1
LDY #0
STY GRBPNT+1
STY GRBPNT
LDA STREND
LDX STREND+1
STA GRBTOP
STX GRBTOP+1
LDA #<TEMPST
LDX #>TEMPST
STA INDEX1
STX INDEX1+1
TVAR CMP TEMPPT
BEQ SVARS
JSR DVAR
BEQ TVAR
SVARS LDA #6+ADDPRC
STA FOUR6
LDA VARTAB
LDX VARTAB+1
.FIL CODE15