mirror of
https://github.com/hsoft/collapseos.git
synced 2024-09-07 08:08:46 +10:00
34 lines
535 B
Bash
Executable File
34 lines
535 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
TMPFILE=$(mktemp)
|
|
SCAS=scas
|
|
ZASM=../../../tools/emul/zasm
|
|
ASMFILE=../instr.asm
|
|
|
|
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
|
|
}
|
|
|
|
./geninstrs.py $ASMFILE | \
|
|
while read line; do
|
|
echo $line | tee "${TMPFILE}"
|
|
cmpas ${TMPFILE}
|
|
done
|
|
|
|
for fn in *.asm; do
|
|
echo "Comparing ${fn}"
|
|
cmpas $fn
|
|
done
|