( uxncli format-c.rom file.bin ) |10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1 |a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |0000 @src $40 |0100 @on-reset ( -> ) ;on-console .Console/vector DEO2 BRK @on-console ( -> ) .Console/read DEI .src skey ?{ BRK } #800f DEO BRK @ ( src* -- ) ;src .File/name DEO2 #0001 .File/length DEO2 ;dict/header [ LIT2r 0000 ] &stream ( -- ) ;&buf feof ?&end [ LIT2 "0 18 ] DEO [ LIT2 "x 18 ] DEO [ LIT &buf $1 ] /b [ LIT2 ", 18 ] DEO #2018 DEO INC2r ( lb ) STHkr #0f AND ?{ #0a18 DEO #0918 DEO } !&stream &end POP2r #0a18 DEO ;dict/footer ! ( @|stdlib ) @skey ( key buf -- proc ) OVR #21 LTH ?{ #00 SWP scap/ STA #00 JMP2r } POP2 #01 JMP2r @scap ( str* -- end* ) &w ( -- ) INC2 & LDAk ?&w JMP2r @feof ( buf* -- f ) .File/read DEO2 .File/success DEI2 #0000 EQU2 JMP2r @ ( short* -- ) SWP /b &b ( -- ) DUP #04 SFT /c &c ( -- ) #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO JMP2r @ ( str* -- ) &w ( -- ) LDAk #18 DEO INC2 & LDAk ?&w POP2 JMP2r @dict &header "unsigned 20 "char 20 "rom[] 20 "= 20 "{ 0a 09 $1 &footer "}; 0a 00