.;ASMGEN.CMD
.; UNIVERSIAL MACRO COMMAND FILE GENERATOR
.;
.;
.; EDIT NUMBER = 0000
.;
.;
.;
.; VARIABLES USED:
.;
.;	$PROC1 => NAME OF FIRST PROCESS ON INPUT
.;	$PROC2 => NAME OF SECOND PROCESS ON INPUT TO MAKE OBJ
.;	$SRCLB => NAME OF SOURCE LIBRARY
.;	$INFIL => NAME OF FILE OF NAMES
.;	$LSUIC => LISTING UIC
.;	$OBUIC => OBJECT UIC
.;	$SRUIC => SOURCE UIC
.;	$LSDEV => LIST DEVICE
.;	$OBDEV => OBJECT DEVICE
.;	$SRDEV => SOURCE DEVICE
.;	$LSOPT => LISTING OPTIONS
.;	$ASPRF => PREFIX FILES FOR ASSEMBLY
.;	$LIST => LISTING DESIRED
.;	$PRJPF => PROJECT PREFIX
.;	$GRUP => GROUP NUMBER
.;	$MEM  => MEMBER NUMBER
.;
.;
	.IFNDF $PRJPF .ASKS $PRJPF WHAT IS THE PROJECT PREFIX
	.IFNDF $LIST  .ASK $LIST DO YOU WANT LISTINGS
	.IFNDF $INFIL  .ASKS $INFIL WHAT IS THE NAME OF THE SELECTION FILE
	 .IFT $LIST .IFNDF $LSUIC  .ASKS $LSUIC WHAT IS THE LISTING UIC
	.IFNDF $OBUIC  .ASKS $OBUIC WHAT IS THE OBJECT UIC
	.IFNDF $SRUIC  .ASKS $SRUIC WHAT IS THE SOURCE UIC
	.IFT $LIST .IFNDF $LSDEV  .ASKS $LSDEV WHAT IS THE LISTING DEVICE
	.IFNDF $OBDEV  .ASKS $OBDEV WHAT IS THE OBJECT DEVICE
	.IFNDF $SRDEV  .ASKS $SRDEV WHAT IS THE SOURCE DEVICE
	.IFT $LIST .IFNDF $LSOPT  .ASKS $LSOPT WHAT ARE THE LISTING OPTIONS (/SP/CR)
	.IFNDF $ASPRF  .ASKS $ASPRF WHAT FILES ARE PREFIXED TO ASSEMBLY STRING
	.IFT $LIST .GOTO 1
	.SETS $LSUIC ""
	.SETS $LSDEV ""
	.SETS $LSOPT ""
.1:

.; GENERATE  OBJECT PRODUCERS COMMAND FILES

	.IF $SRUIC = "" .SETS $SRUIC <UIC>
	.IF $OBUIC = "" .SETS $OBUIC <UIC>
	.IF $LSUIC = "" .SETS $LSUIC <UIC>

	.OPENR #1 ['$GRUP',200]'$INFIL'

	.SETS $PROC1 ""
	.SETS $PROC2 ""
	.SETF DOUBL
	.READ #1 B
	.PARSE B ";" C A
	.IF A = "MAC" .GOTO M1
	.IF A = "F4P" .GOTO F1
	.IF A = "PAS" .GOTO P1
	.IF A = "PRX" .GOTO X1
;
; INCORRECT FIRST LINE OF SELECTION FILE
; IT MUST BE OF THE FORM ";ARG" WHERE ARG MAY BE
; MAC, PAS, F4P, PRX
;
/
.M1:
	.SETS $PROC1 "MAC"
	.GOTO SLEND
.F1:
	.SETS $PROC1 "F4P"
	.GOTO SLEND
.P1:
	.SETS $PROC1 "PAS"
	.SETS $PROC2 "MAC"
	.SETT DOUBL
	.GOTO SLEND
.X1:
;
; COL => PRAXIS IS
; CURRENTLY NOT IMPLEMENTED
/
.SLEND:
	.OPEN #2 '$SRUIC''$PRJPF''$PROC1'.CMD
	.OPEN #3 '$OBUIC''$PRJPF'PIP.CMD
	.IFT DOUBL .OPEN #0 '$SRUIC''$PRJPF''$PROC2'.CMD
	.SETT FIRST
.2:
	.READ #1 A
	.IFT <EOF> .GOTO ENDF
	.PARSE A ";" B C
	.IF B = "" .GOTO 2
	.SETS AA ""
	.SETS BB ""
	.IF $ASPRF NE BB .SETS BB $ASPRF+","
	.IFT $LIST .SETS AA ","+$LSDEV+$LSUIC+B+$LSOPT
	.DATA #2 '$OBDEV''$OBUIC''B''AA'='BB''$SRDEV''$SRUIC''B'
	.IFT DOUBL .DATA #0 '$OBDEV''$OBUIC''B'='$OBDEV''$OBUIC''B'
	.IFT FIRST .DATA #3  '$OBDEV''$OBUIC''$PRJPF'OBJ.OOO='$OBDEV''$OBUIC''B'.OBJ
	.IFF FIRST .DATA #3 '$OBDEV''$OBUIC''$PRJPF'OBJ.OOO='$OBDEV''$OBUIC''B'.OBJ/AP
	.SETF FIRST
	.GOTO 2

.ENDF:
	.CLOSE #2
	.CLOSE #3
	.IFT DOUBL  .CLOSE #0
	.CLOSE #1
	.OPENR #1 ['$GRUP',200]'$INFIL'
	.OPEN #2 '$SRUIC''$PRJPF'DEL.CMD
	.OPEN #0 '$SRUIC''$PRJPF'EXT.CMD
.3:
	.READ #1 A
	.IFT <EOF> .GOTO ENDF2
	.PARSE A ";" B C
	.IF B = "" .GOTO 3
	.SETS AA ""
	.SETS BB ""
	.DATA #0 '$SRDEV''$SRUIC''B'.MAC='$SRCLB'/EX:'B'
	.DATA #2 '$SRDEV''$SRUIC''B'.'$PROC1';*/DE,'$OBDEV''$OBUIC'.OBJ;*
	.IFT DOUBL .DATA #2 '$OBDEV''$OBUIC'.'$PROC2';*/DE
	.GOTO 3
.ENDF2:
	.CLOSE #1
	.CLOSE #0
	.CLOSE #2
