2019-04-17 21:03:20 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
TMPFILE=$(mktemp)
|
|
|
|
SCAS=scas
|
|
|
|
ZASM=../emul/zasm
|
2019-04-20 22:37:38 -04:00
|
|
|
ASMFILE=../zasm.asm
|
2019-04-17 21:03:20 -04:00
|
|
|
|
2019-04-20 22:37:38 -04:00
|
|
|
./geninstrs.py $ASMFILE | \
|
2019-04-17 21:03:20 -04:00
|
|
|
while read line; do
|
|
|
|
echo $line | tee "${TMPFILE}"
|
|
|
|
EXPECTED=$($SCAS -o - "${TMPFILE}" | xxd)
|
|
|
|
ACTUAL=$(echo $line | $ZASM | xxd)
|
|
|
|
if [ "$ACTUAL" == "$EXPECTED" ]; then
|
|
|
|
echo ok
|
|
|
|
else
|
|
|
|
echo actual
|
|
|
|
echo $ACTUAL
|
|
|
|
echo expected
|
|
|
|
echo $EXPECTED
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|