diff --git a/cli/hx/hx.tal b/cli/hx/hx.tal index 594ce2f..b1b7407 100644 --- a/cli/hx/hx.tal +++ b/cli/hx/hx.tal @@ -10,10 +10,10 @@ |0100 @on-reset ( -> ) - .Console/type DEI ?&>has-arg - ;Dict/usage + .Console/type DEI ?{ + ;Dict/usage / #010f DEO - BRK &>has-arg + BRK } ;await-src .Console/vector DEO2 BRK @@ -24,44 +24,45 @@ @on-ready ( -> ) ;src .File/name DEO2 #0001 .File/length DEO2 - #00 + #0a19 DEO + #0000 &stream ( -- ) ;&b .File/read DEO2 .File/success DEI2 #0000 EQU2 ?&eof [ LIT &b $1 ] /b - INC DUP + INC2 DUP !&stream &eof ( id -- ) - POP #0a18 DEO + #0a19 DEOk DEO + + ;Dict/bytes + ;src + #0a19 DEO #800f DEO BRK @ ( id -- ) - DUP #0f AND ?&>no-lb + DUP #0f AND ?{ POP #0a18 DEO - JMP2r &>no-lb - #01 AND ?&>end - #2018 DEO &>end + JMP2r } + #01 AND ?{ #2018 DEO } JMP2r ( @|stdlib ) @skey ( key buf -- proc ) - OVR #21 LTH ?&eval - #00 SWP sput #00 JMP2r - &eval ( -- ) - POP2 #01 JMP2r + 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 @ ( short* -- ) @@ -73,14 +74,23 @@ JMP2r @ ( err* -- ) - !&a &w ( -- ) LDAk #19 DEO - INC2 &a LDAk ?&w + INC2 & LDAk ?&w POP2 JMP2r +@ ( short* -- ) + #2710 [ LIT2r 00fb ] + &w ( -- ) + DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{ + DUP [ LIT "0 ] ADD #19 DEO + INCr } + POP2 #000a DIV2 SWPr INCr STHkr ?&w + POP2r POP2 POP2 JMP2r + ( @|res ) @Dict &usage "usage: 20 "hx.rom 20 "input.bin 0a $1 + &bytes 20 "bytes 20 "in 20 $1