if "("  "(" $1 != gt40 ")" 
  -a "(" $1 != seq ")"
  -a "(" $1 != lsi ")"  ")"   goto noname

if $1 = seq goto sequential

if -r a.out rm a.out

/usr/lib/modula /usr/lib/modovly g $2 $3 $4 $5 $6 $7
if ! "(" -r a.out ")" goto mess
if $1 != lsi goto skipped

ed - a.out
1a
        mtps = 106400^tst
.
g/177776/s/,\*\$177776//\
s/mov/mtps/
w
q

: skipped

if "(" $1 = gt40 ")" as a.out /usr/lib/a.gt40.s /usr/lib/modnucl.s
if $1 = lsi  as a.out /usr/lib/a.lsi.s /usr/lib/modnucl.s

mv a.out a.in
if $1 = lsi  utl a.in a.out 
if $1 = gt40 utg a.in a.out 
rm a.in

: mess
echo York MODULA 01.00 Compilation complete
exit


: noname
echo Processor name not given
echo possible processors are gt40 lsi seq
exit


: sequential
shift

ed - $1
/MODULE/r /usr/lib/seqmodio.mod
w a.in
q
/usr/lib/modula /usr/lib/modovly $2 $3 $4 $5 $6 $7  a.in
ed - a.out
/L1:/,/L4:/d
i
L1:	jmp	openf
L2:	jmp	rewrit
L3:	jmp	getch
L4:	jmp	putch
.
w
q
mv a.out a.in
as a.in /usr/lib/seqmod.s
mv a.out a.in
ld a.in -l
rm a.in
exit
