This repository has been archived by the owner on May 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
6809-loop.sh
executable file
·79 lines (76 loc) · 2.11 KB
/
6809-loop.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
echo "6809-Assembly"
PS3="
Pick an option: "
options=(
"Full Assembly to Compiled Hex"
"Full Compiled Hex to Assembly"
"Opcode Assembly to Compiled Hex"
"Opcode Compiled Hex to Assembly"
"Post-byte Assembly to Compiled Hex"
"Post-byte Compiled Hex to Assembly"
)
while [ true ]; do
select option in "${options[@]}"; do
case "$option" in
"Full Assembly to Compiled Hex")
echo -n "Enter Assembly: "
read input
echo ""
node "$HERE"/6809-Assembly.js 3 2 "$input"
echo ""
break
;;
"Full Compiled Hex to Assembly")
echo -n "Enter Hex: "
read input
echo ""
node "$HERE"/6809-Assembly.js 3 1 "$input"
echo ""
break
;;
"Opcode Assembly to Compiled Hex")
echo -n "Enter Assembly: "
read input
echo "Addressing Modes:"
node "$HERE"/6809-Assembly.js "modes"
echo -n "Enter an addressing mode number: "
read mode
echo ""
node "$HERE"/6809-Assembly.js 1 2 "$input" "$mode"
echo ""
break
;;
"Opcode Compiled Hex to Assembly")
echo -n "Enter Hex: "
read input
echo ""
node "$HERE"/6809-Assembly.js 1 1 "$input"
echo ""
break
;;
"Post-byte Assembly to Compiled Hex")
echo -n "Enter Assembly: "
read input
echo ""
node "$HERE"/6809-Assembly.js 2 2 "$input"
echo ""
break
;;
"Post-byte Compiled Hex to Assembly")
echo -n "Enter Hex: "
read input
echo ""
node "$HERE"/6809-Assembly.js 2 1 "$input"
echo ""
break
;;
*)
echo "Do you see '$REPLY' in the options? FOCUS."
break
;;
esac
done
echo ''
done