#!/bin/sh

ID="b64enc"
ASM="uxncli $HOME/roms/drifblim.rom"
EMU="uxncli"
LIN="uxncli $HOME/roms/uxnlin.rom"
SRC="${ID}.tal"
DST="${ID}.rom"
CPY="$HOME/roms"
ARG="Many hands make light work."

if [[ "$*" == *"--lint"* ]]
then
	$LIN $SRC
fi

$ASM $SRC $DST

if [[ "$*" == *"--save"* ]]
then
	cp $DST $CPY
fi

echo "source: ${ARG}"
echo "target: TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu"
echo -n "result: " 
echo -n "${ARG}" | $EMU $DST
echo ""