performance-aware/test_registers.sh

24 lines
541 B
Bash
Executable File

#!/bin/sh
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
make asm_files > /dev/null
if [ ! "$(command -v ./sim8086)" ]; then
echo -e "\nError: 'sim8086' executable not found"
exit 1
fi
odin build . -out:sim8086
for asm_txt in asm_files/*.txt;
do
asm_listing=$(basename $asm_txt .txt)
./sim8086 asm_files/${asm_listing}.bin registers | awk '{print $1 $4}' | sort > temp1
cat $asm_txt | awk '/Final registers/,0' | tail -n +2 | awk '{print $1 $2}' | sort > temp2
diff -U0 --color temp1 temp2
done
rm temp1 temp2