diff --git a/cli/format-c/build.sh b/cli/format-c/build.sh index 894de53..71f2240 100755 --- a/cli/format-c/build.sh +++ b/cli/format-c/build.sh @@ -1,32 +1,25 @@ #!/bin/sh -e +ID="format-c" ASM="uxncli $HOME/roms/drifblim.rom" EMU="uxncli" LIN="uxncli $HOME/roms/uxnlin.rom" - -SRC="format-c.tal" -DST="format-c.rom" - +SRC="${ID}.tal" +DST="${ID}.rom" CPY="$HOME/roms" ARG="test.txt" -echo ">> Cleaning" - if [[ "$*" == *"--lint"* ]] then - echo ">> Linting $SRC" $LIN $SRC fi -echo ">> Assembling $SRC" $ASM $SRC $DST if [[ "$*" == *"--save"* ]] then - echo ">> Saving $DST" cp $DST $CPY fi -echo ">> Running $DST" $EMU $DST $ARG diff --git a/cli/format-c/format-c.tal b/cli/format-c/format-c.tal index a5ad360..be68d84 100644 --- a/cli/format-c/format-c.tal +++ b/cli/format-c/format-c.tal @@ -7,7 +7,7 @@ @src $40 -|0100 ( -> ) +|0100 @on-reset ( -> ) ;on-console .Console/vector DEO2 @@ -18,23 +18,23 @@ BRK [ LIT2r =src ] ( read input ) .Console/read DEI - DUP #20 LTH OVR #7f GTH ORA ?&end - STH2kr slen #003f GTH2 ?&end + DUP #20 LTH OVR #7f GTH ORA ?&>end + STH2kr slen #003f GTH2 ?&>end STH2kr scap STA POP2r BRK - &end + &>end POP - STH2r print-program + STH2r #010f DEO BRK -@print-program ( src* -- ) +@ ( src* -- ) .File/name DEO2 #0001 .File/length DEO2 ;dict/header pstr LIT2r 0000 - &stream + &stream ( -- ) #00 ,&buf STR ;&buf .File/read DEO2 .File/success DEI2 #0000 EQU2 ?&end