( uxncli hx.rom file.bin ) |10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1 |a0 @File &vector $2 &success $1 &succ-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |000 @src |100 @on-reset ( -> ) .Console/type DEI ?{ ;Dict/usage #010f DEO BRK } ;await-src .Console/vector DEO2 BRK @await-src ( -> ) .Console/read DEI ( ) DUP #20 GTH ?{ POP !on-ready } [ LIT2 00 &ptr -src ] INCk ,&ptr STR STZ2 BRK @on-ready ( -> ) ;src .File/name DEO2 #0001 .File/length DEO2 #0a19 DEO #0000 &>stream ( -- ) ;&b .File/read DEO2 [ LIT2 00 -File/succ-lb ] DEI EQU ?{ [ LIT &b $1 ] INC2 DUP !&>stream } #0a19 DEOk DEO ;Dict/bytes ;src #0a19 DEO #800f DEO BRK @ ( id -- ) DUP #0f AND ?{ POP #0a18 DEO JMP2r } #01 AND ?{ #2018 DEO } JMP2r ( @|stdlib ) @ ( short* -- ) DUP #04 SFT /c &c ( -- ) #0f AND DUP #09 GTH #27 MUL ADD LIT "0 ADD #18 DEO JMP2r @ ( err* -- ) LDAk #19 DEO INC2 LDAk ? POP2 JMP2r @ ( short* -- ) [ LIT2r ff00 ] &>read ( -- ) #000a DIV2k STH2k MUL2 SUB2 STH2r INCr ORAk ?&>read POP2 &>write ( -- ) NIP #30 ADD #19 DEO OVRr ADDr STHkr ?&>write POP2r JMP2r ( @|res ) @Dict &usage "usage: 20 "hx.rom 20 "input.bin 0a $1 &bytes 20 "bytes 20 "in 20 $1