(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
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

View File

@ -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 <print-program>
#010f DEO
BRK
@print-program ( src* -- )
@<print-program> ( 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