( usage: drifblim.rom input.tal output.rom ) |00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1 |10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1 |a0 @File &vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |00 @RefType &ab $1 &as $1 &rb $1 &rs $1 |00 @SymType $40 &used $40 &declared |000 @token/buf $2f &cap $1 @scope/buf $2f &cap $1 @src/buf $2f &cap $1 @dst/buf $2f &cap $1 |100 @on-reset ( -> ) ;meta #06 DEO2 ;dict/reset scope/ ;src/on-console ( >> ) @bind ( vector* -> ) .Console/vector DEO2 [ LIT2 03 -Console/type ] DEI AND ?{ ;dict/usage [ LIT2 01 -System/state ] DEO } BRK @src/on-console ( -> ) .Console/read DEI DUP #20 GTH ?{ POP ;dst/on-console !bind } [ LIT2 00 &ptr -&buf ] INCk ,&ptr STR DUP .&cap LTH ?{ ;dict/exceeded ;dict/Path ;&buf } STZ2 BRK @dst/on-console ( -> ) .Console/read DEI DUP #20 GTH ?{ } [ LIT2 00 &ptr -&buf ] INCk ,&ptr STR DUP .&cap LTH ?{ ;dict/exceeded ;dict/Path ;&buf } STZ2 BRK @ ( -- ) ;src/buf .System/state DEI ?{ refs/ .System/state DEI ?{ rom/ } } JMP2r @lib/inctal INC2 ( >> ) @ ( f* -- ) .File/name DEO2 #0001 .File/length DEO2 token/ #0000 &>s ( len* -- ) .System/state DEI ?&end ;&c .File/read DEO2 .File/success-lb DEI ?{ ORAk ?{ ;dict/invalid ;dict/File ;src/buf } &end ( i* -- ) POP2 JMP2r } INC2 [ LIT &c $1 ] token/ !&>s @rom/ ( -- ) ( +length ) [ LIT2 &length $2 ] ( +labels ) syms/ ;dict/assembled ;dst/buf / ;dict/in OVR2 #0100 SUB2 ;dict/bytes ( -labels ) ;dict/labels ( | export ) ;dst/buf .File/name DEO2 ( -length ) #0100 SUB2 .File/length DEO2 ;&output .File/write DEO2 ( | success ) [ LIT2 80 -System/state ] DEO JMP2r @runes/db [ "| =lib/padabs "$ =lib/padrel "@ =lib/toplab "& =lib/sublab "% =lib/macros "( =lib/coment ", =lib/litrel "_ =lib/rawrel ". =lib/litzep "- =lib/rawzep "; =lib/litabs "= =lib/rawabs "? =lib/litjci "! =lib/litjmi "# =lib/lithex "" =lib/rawstr "} =lib/lambda "~ =lib/inctal 5b =lib/ignore 5d =lib/ignore ] &db-end @dict/usage "usage: 20 "drifblim.rom 20 "in.tal 20 "out.rom 0a $1 @dict/Path "Path $1 @meta $1 ( name ) "Drifblim 0a ( desc ) "Uxntal 20 "Assembler 0a ( auth ) "By 20 "Devine 20 "Lu 20 "Linvega 0a ( date ) "19 20 "Jan 20 "2025 $2 ~src/core.tal