(symbols.tal) Converted loop to using range of filesize

This commit is contained in:
neauoire 2023-08-06 09:54:22 -07:00
parent 8122716482
commit 584508fda5
1 changed files with 20 additions and 35 deletions

View File

@ -10,56 +10,43 @@
|0100
@on-reset ( -> )
.Console/type DEI ?&>has-arg
;Dict/usage <perr>
.Console/type DEI ?{
;Dict/usage <perr>/
#010f DEO
BRK &>has-arg
BRK }
;await-src .Console/vector DEO2
BRK
@await-src ( -> )
.Console/read DEI .src skey ?on-ready
BRK
@on-ready ( -> )
.Console/read DEI .src skey ?{ BRK }
;src .File/name DEO2
#8000 .File/length DEO2
;sym .File/read DEO2
;sym
&w
LDA2k <phex> #2018 DEO
INC2 INC2 DUP2 <pstr> #0a18 DEO
scap INC2 LDA2k ORA ?&w
POP2
#800f DEO
;sym DUP2 .File/read DEO2
.File/success DEI2 ADD2 ;sym
&l ( -- )
LDA2k <phex>
#2018 DEO
INC2 INC2 DUP2 <pstr>/
#0a18 DEO
scap/ INC2 GTH2k ?&l
POP2 #800f DEO
BRK
@<print-spacer> ( id -- )
DUP #0f AND ?&>no-lb
POP #0a18 DEO
JMP2r &>no-lb
#01 AND ?&>end
#2018 DEO &>end
JMP2r
(
@|stdlib )
@skey ( key buf -- proc )
OVR #21 LTH ?&eval
#00 SWP sput #00 JMP2r
&eval ( -- )
OVR #21 LTH ?{
#00 SWP sput #00 JMP2r }
POP2 #01 JMP2r
@scap ( str* -- end* )
!&a
&w ( -- )
INC2 &a LDAk ?&w
INC2 & LDAk ?&w
JMP2r
@sput ( chr str* -- )
scap INC2k #00 ROT ROT STA
STA
scap/ ROT #00 SWP2 STA2
JMP2r
@<phex> ( short* -- )
@ -71,17 +58,15 @@
JMP2r
@<pstr> ( err* -- )
!&a
&w ( -- )
LDAk #19 DEO
INC2 &a LDAk ?&w
INC2 & LDAk ?&w
POP2 JMP2r
@<perr> ( err* -- )
!&a
&w ( -- )
LDAk #19 DEO
INC2 &a LDAk ?&w
INC2 & LDAk ?&w
POP2 JMP2r
(