-
Notifications
You must be signed in to change notification settings - Fork 3
/
check_asm.sh
executable file
·47 lines (37 loc) · 1.06 KB
/
check_asm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
if [ $# -ne 1 ]; then
echo "usage: ./check_asm.sh [-del] [-exec] [-diff] [-deasm]"
fi
if [ "$1" == "-del" ]; then
rm ./resources/champions/*.cor
rm -rf ./resources/champions/mine
fi
if [ "$1" == "-exec" ]; then
echo "------------- MY ASM ---------------"
mkdir ./resources/champions/mine
for filename in ./resources/champions/*.s; do
./Corewar/asm $filename
done
mv ./resources/champions/*.cor ./resources/champions/mine
echo "---------- RESOURCE ASM ------------"
for filename in ./resources/champions/*.s; do
./resources/asm $filename
done
fi
if [ "$1" == "-diff" ]; then
for filename in ./resources/champions/mine/*.cor; do
diff ./resources/champions/${filename##*/} $filename
done
fi
if [ "$1" == "-deasm" ]; then
for filename in ./resources/champions/mine/*.cor; do
./Corewar/asm -d $filename
done
rm -rf ./resources/champions/mine/*.cor
for filename in ./resources/champions/mine/*.s; do
./Corewar/asm $filename
done
for filename in ./resources/champions/mine/*.cor; do
diff ./resources/champions/${filename##*/} $filename
done
fi