1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-08 20:28:05 +11:00
collapseos/apps/zasm/tests/runtests.sh

38 lines
597 B
Bash
Raw Normal View History

#!/bin/sh
set -e
TMPFILE=$(mktemp)
SCAS=scas
2019-05-10 04:09:40 +10:00
ZASM=../../../tools/emul/zasm
2019-05-01 05:51:39 +10:00
ASMFILE=../instr.asm
2019-05-01 05:51:39 +10:00
cmpas() {
EXPECTED=$($SCAS -o - "$1" | xxd)
ACTUAL=$(cat $1 | $ZASM | xxd)
if [ "$ACTUAL" == "$EXPECTED" ]; then
echo ok
else
echo actual
echo $ACTUAL
echo expected
echo $EXPECTED
exit 1
fi
2019-05-01 05:51:39 +10:00
}
2019-05-15 06:50:35 +10:00
echo "Comparing core.asm"
cmpas ../../../parts/z80/core.asm
2019-05-15 03:53:12 +10:00
for fn in *.asm; do
echo "Comparing ${fn}"
cmpas $fn
done
2019-05-01 05:51:39 +10:00
./geninstrs.py $ASMFILE | \
while read line; do
echo $line | tee "${TMPFILE}"
cmpas ${TMPFILE}
done