-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathcode12.src
194 lines (178 loc) · 1.83 KB
/
code12.src
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
.page
.subttl 'code12'
n32768 .byte 144,128,0,0,0
flpint
jsr ayint
lda facmo
ldy faclo
rts
intidx
jsr chrget
jsr frmevl
posint
jsr chknum
lda facsgn
bmi nonono
ayint
lda facexp
cmp #144
bcc qintgo
lda #<n32768
ldy #>n32768
jsr fcomp
nonono
bne qintgo
jmp fcerr
qintgo
jmp qint
isary
lda dimflg
ora intflg
pha
lda valtyp
pha
ldy #0
indlop tya
pha
lda varnam+1
pha
lda varnam
pha
jsr intidx
pla
sta varnam
pla
sta varnam+1
pla
tay
tsx
lda 258,x
pha
lda 257,x
pha
lda indice
sta 258,x
lda indice+1
sta 257,x
iny ;y counts # of subscripts
sty count ;protect y from chrget
jsr chrgot
ldy count
cmp #',' ;more subscripts?
beq indlop
jsr chkcls
pla
sta valtyp
pla
sta intflg
and #$7f
sta dimflg
ldx arytab
lda arytab+1
lopfda
stx lowtr
sta lowtr+1
cmp strend+1
bne lopfdv
cpx strend
beq notfdd
lopfdv
ldy #0
jsr indlow
iny
cmp varnam
bne nmary1
jsr indlow
sta syntmp
lda varnam+1
cmp syntmp
beq gotary
nmary1
iny
jsr indlow
clc
adc lowtr
tax
iny
jsr indlow
adc lowtr+1
bcc lopfda
bserr ldx #errbs
.byte $2c
fcerr ldx #errfc
errgo3 jmp error
gotary
ldx #errdd
lda dimflg
bne errgo3
jsr fmaptr
ldy #4
jsr indlow
sta syntmp
lda count
cmp syntmp
bne bserr
jmp getdef
notfdd
jsr fmaptr
jsr reason
ldy #0
sty curtol+1
ldx #5
lda varnam
sta (lowtr),y
bpl notflt
dex
notflt
iny
lda varnam+1
sta (lowtr),y
bpl stomlt
dex
dex
stomlt
stx curtol
lda count
iny
iny
iny
sta (lowtr),y
loppta
ldx #11
lda #0
bit dimflg
bvc notdim
pla
clc
adc #1
tax
pla
adc #0
notdim
iny
sta (lowtr),y
iny
txa
sta (lowtr),y
jsr umult
stx curtol
sta curtol+1
ldy index
dec count
bne loppta
adc arypnt+1
bcs omerr1
sta arypnt+1
tay
txa
adc arypnt
bcc grease
iny
beq omerr1
grease
jsr reason
sta strend
sty strend+1
lda #0
inc curtol+1
;.end