2019-12-13 17:38:40 -05:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2019-12-31 15:07:39 -05:00
|
|
|
ZASM=../../emul/zasm/avra
|
2019-12-31 13:07:05 -05:00
|
|
|
AVRINC=../../avr
|
2019-12-13 17:38:40 -05:00
|
|
|
|
|
|
|
cmpas() {
|
|
|
|
FN=$1
|
|
|
|
EXPECTED=$(xxd ${FN%.*}.expected)
|
2019-12-31 15:07:39 -05:00
|
|
|
ACTUAL=$(cat ${FN} | "${ZASM}" "${AVRINC}" | xxd)
|
2019-12-13 17:38:40 -05:00
|
|
|
if [ "$ACTUAL" = "$EXPECTED" ]; then
|
|
|
|
echo ok
|
|
|
|
else
|
|
|
|
echo actual
|
|
|
|
echo "$ACTUAL"
|
|
|
|
echo expected
|
|
|
|
echo "$EXPECTED"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -z $1 ]; then
|
|
|
|
cmpas $1
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
for fn in *.asm; do
|
|
|
|
echo "Comparing ${fn}"
|
|
|
|
cmpas $fn
|
|
|
|
done
|