File tree 1 file changed +17
-15
lines changed
1 file changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -186,19 +186,23 @@ xit: sec
186
186
beq read_hex
187
187
188
188
jsr read_word
189
- bcs E_EOL ::xit
190
189
191
190
.ifdef FASTBASIC_FP
191
+ bcs E_EOL ::xit
192
+
192
193
; In FP version, fails if number is followed by decimal dot
193
194
sta tmp1
194
195
lda (bptr), y
195
196
cmp #'.'
196
197
beq E_EOL ::xit
197
198
lda tmp1
198
- .endif ; FASTBASIC_FP
199
199
200
200
sty bpos
201
201
jmp emit_AX
202
+ .else
203
+ bcc xit_emit
204
+ rts
205
+ .endif ; FASTBASIC_FP
202
206
203
207
read_hex:
204
208
nloop:
@@ -209,11 +213,11 @@ nloop:
209
213
sbc #'0'
210
214
cmp #10
211
215
bcc digit
212
- cmp #'A' -'0'
213
- bcc xit
214
- sbc #'A' -'0' -10
215
- cmp #16
216
+
217
+ sbc #'A' -'0'
218
+ cmp #6
216
219
bcs xit ; Not an hex number
220
+ adc #10 ; set to range 10-15
217
221
218
222
digit:
219
223
sta tmp1 ; and save digit
@@ -225,14 +229,11 @@ digit:
225
229
226
230
; Multiply tmp by 16
227
231
txa
228
- asl
229
- rol tmp1+1
230
- asl
231
- rol tmp1+1
232
- asl
233
- rol tmp1+1
234
- asl
232
+ ldx #4
233
+ : asl
235
234
rol tmp1+1
235
+ dex
236
+ bne :-
236
237
237
238
; Add new digit
238
239
ora tmp1
@@ -249,10 +250,11 @@ xit:
249
250
; cpy bpos ; Check that we consumed at least one character
250
251
; beq ret ; Exit with C = 1 (if Y == bpos, C = 1)
251
252
252
- sty bpos
253
-
254
253
txa
255
254
ldx tmp1+1
255
+ xit_emit:
256
+
257
+ sty bpos
256
258
jmp emit_AX
257
259
.endproc
258
260
You can’t perform that action at this time.
0 commit comments