(format-c) Housekeeping

This commit is contained in:
neauoire 2023-08-02 08:27:55 -07:00
parent 795d9cb321
commit 7220b5f227
2 changed files with 10 additions and 17 deletions

View File

@ -1,32 +1,25 @@
#!/bin/sh -e #!/bin/sh -e
ID="format-c"
ASM="uxncli $HOME/roms/drifblim.rom" ASM="uxncli $HOME/roms/drifblim.rom"
EMU="uxncli" EMU="uxncli"
LIN="uxncli $HOME/roms/uxnlin.rom" LIN="uxncli $HOME/roms/uxnlin.rom"
SRC="${ID}.tal"
SRC="format-c.tal" DST="${ID}.rom"
DST="format-c.rom"
CPY="$HOME/roms" CPY="$HOME/roms"
ARG="test.txt" ARG="test.txt"
echo ">> Cleaning"
if [[ "$*" == *"--lint"* ]] if [[ "$*" == *"--lint"* ]]
then then
echo ">> Linting $SRC"
$LIN $SRC $LIN $SRC
fi fi
echo ">> Assembling $SRC"
$ASM $SRC $DST $ASM $SRC $DST
if [[ "$*" == *"--save"* ]] if [[ "$*" == *"--save"* ]]
then then
echo ">> Saving $DST"
cp $DST $CPY cp $DST $CPY
fi fi
echo ">> Running $DST"
$EMU $DST $ARG $EMU $DST $ARG

View File

@ -7,7 +7,7 @@
@src $40 @src $40
|0100 ( -> ) |0100 @on-reset ( -> )
;on-console .Console/vector DEO2 ;on-console .Console/vector DEO2
@ -18,23 +18,23 @@ BRK
[ LIT2r =src ] [ LIT2r =src ]
( read input ) ( read input )
.Console/read DEI .Console/read DEI
DUP #20 LTH OVR #7f GTH ORA ?&end DUP #20 LTH OVR #7f GTH ORA ?&>end
STH2kr slen #003f GTH2 ?&end STH2kr slen #003f GTH2 ?&>end
STH2kr scap STA POP2r BRK STH2kr scap STA POP2r BRK
&end &>end
POP POP
STH2r print-program STH2r <print-program>
#010f DEO #010f DEO
BRK BRK
@print-program ( src* -- ) @<print-program> ( src* -- )
.File/name DEO2 .File/name DEO2
#0001 .File/length DEO2 #0001 .File/length DEO2
;dict/header pstr ;dict/header pstr
LIT2r 0000 LIT2r 0000
&stream &stream ( -- )
#00 ,&buf STR #00 ,&buf STR
;&buf .File/read DEO2 ;&buf .File/read DEO2
.File/success DEI2 #0000 EQU2 ?&end .File/success DEI2 #0000 EQU2 ?&end