bc3f9595bcef1045c5ce5c55806bed089eeb1cbb
[h316.git] / asm_original
1 #!/bin/sh
2 # Assembler wrapper for simh h316
3
4 if [ ! $1 ] ; then
5 echo "Assembler (Original): Input file missing!"
6 exit 2
7 fi
8
9 echo -en "Assembler (Original): Translating \"$1\":"
10
11 for n in $*; do
12 if [ $n == "/v" ]; then
13 VERBOSE=yes
14 fi
15 done
16
17 name=`basename $1 .asm`
18 listfile=$name.lst
19
20 cat $1 | tab | paron > $name.par
21
22 rm -f $name.lst
23 rm -f $name.obj
24
25 cat > $name.go <<EOF
26 at ptr $H316/honeywell/slst/dap_8k.slst
27 boot ptr
28 r
29 d a 120420
30 d p 1000
31 at ptr $name.par
32 at ptp $name.obj
33 at tty3 $listfile
34 set tty3 uascii
35 set tty3 start
36 go
37 d ptr pos 0
38 go
39 quit
40 EOF
41
42 if [ "$VERBOSE" == "yes" ]; then
43 h316 $name.go
44 else
45 h316 $name.go > /dev/null
46 fi
47
48
49 if cat $name.lst | grep "NO ERRORS IN ABOVE ASSEMBLY">/dev/null 2>&1; then
50 if [ ! $2 ]; then
51 rm $name.lst
52 rm -f $name.par
53 rm -f $name.go
54 fi
55 echo " Success."
56 exit 0
57 fi
58 cat $name.lst
59 echo -e " Failed."
60 rm -f $name.obj
61 exit 77
62