.;GENSRC.CMD -- FILE TO HELP GENERATE SOURCE MODULES
.;
	.ENABLE QUIET
	.DISABLE LOWERCASE
	.ENABLE SUBSTITUTION
	.ENABLE ESCAPE
	.ENABLE GLOBAL
	.SETF DATAM
	.IFDF $MORM .GOTO GMOD
	.SETF DATAM
	.SETF $GLOBL
	.SETT $SAVE
	.SETF $MORM
	.GOTO A
.INP:
.R2:	.ASKS S
	.IFT <ESCAPE> .GOTO R1
	.DATA #0 '$CC''SEP''S'
	.GOTO R2
.R1:	.RETURN
.1A:	.DISABLE QUIET
	;
	; YOU HAVE THE FOLLOWING SOURCE MODULE TYPES
	;	1) MAC
	;	2) FTN
	;	3) PAS
	;	4) Z80
	;	5) PRX
	;
	.ENABLE QUIET
.A:	.DISABLE QUIET
	;
	; FOR ADDITIONAL INFORMATION ABOUT ANY QUESTION, TYPE THE
	; ESC OR ALTMODE KEY
	;
	.ENABLE QUIET
	.ASKN $TYP WHAT TYPE OF SOURCE
	.IFT <ESCAPE> .GOTO 1A
	.IF $TYP GT 5 .GOTO 1A
	.IF $TYP NE 0 .GOTO 2A
	.SETF SAVE
	.DISABLE QUIET
	; NO TRACE WILL BE GENERATED
	.ENABLE QUIET
	.GOTO A
.2A:	@LB:[17,377]SDEF'$TYP'
	.IF $TYP = 3 .ENABLE LOWERCASE
	.IF $TYP = 5 .ENABLE LOWERCASE
	.IFNDF $TITLF .SETS $TITLF ""
.BBA:	.ASKS [1:9.] $FILE FILE NAME (NO (.) OR EXSTENSION)
	.IFF <ESCAPE> .GOTO BBA1
	.DISABLE QUIET
	;
	; 9 CHARACTER FILE NAME, THE EXTENSION WILL DEFAULT CORRECTLY
	;
	.ENABLE QUIET
	.GOTO BBA
.BBA1:	.OPEN #0 LASTEDIT.CMD;1
	.DATA '$FILE'.'$EXT'
	.CLOSE #0
	.OPEN #0 '$FILE'.'$EXT'
.BB1:	.ASK ZZY NEW ENTRY POINT ONLY
	.IFF <ESCAPE> .GOTO BB2
	.DISABLE QUIET
	;
	; ANSWER NO IF YOU ARE MAKING A NEW FILE.
	; ANSWER YES TO THIS QUESTION ONLY IF YOU ARE MAKING A MODULE
	; TO ADD TO AN EXISTING FILE.
	;
	.ENABLE QUIET
	.GOTO BB1
.BB2:	.IFT ZZY .GOTO GMOD
.BB3:	.ASKS  $TITL TITLE NAME
	.IFF <ESCAPE> .GOTO BB4
	.DISABLE QUIET
	;
	; THIS QUESTION IS FOR THE
	;'$TITLE' "your answer"
	; AT THE START OF THE FILE.
	;
	.ENABLE QUIET
	.GOTO BB3
.BB4:	.IF $TYP = 3 .ASK $GLOBL IS THIS MODULE AN EXTERNAL MODULE
	.IFT $GLOBL .DATA #0 {$E+  '$TITL'  }
	.IFF $GLOBL .DATA #0 '$TITLE''$TITL''$TITLF'
	.IF $IDENT EQ "" .GOTO 3A
.BB5:	.ASKS [1:6] AIDENT IDENT
	.IFF <ESCAPE> .GOTO BB6
	.DISABLE QUIET
	;
	; THIS IS ANSWERED WITH A LEGAL PARAMITER FOR THE
	;'$IDENT' "your answer"
	; NOTE THAT MACRO REQUIRES STARTING AND ENDING DELIMITERS I.E.
	; your answer = /V1/
	;
	.ENABLE QUIET
	.GOTO BB5
.BB6:	.DATA #0 '$IDENT''AIDENT'
.3A:	.ASKS NAME YOUR NAME
	.SETS $DATE <DATE>
	.SETS $TIME <TIME>
.ENABLE DATA #0
'$PCE'
'$PCS''$CC'
'$CC'
'$CC' WRITTEN BY 'NAME'
'$CC' SOFTWARE SUPPORT GROUP (R.S.)
'$CC' '$DATE'
'$CC' FERMILAB
'$CC'
'$CC'
'$CC' '$VER'
'$CC' EDIT NUMBER = 0001
'$CC' FILE = '$FILE'.'$EXT'
'$CC' EDITED BY: 'NAME'  '$DATE' '$TIME'
'$CC'
'$CC'
'$CC' MODIFICATIONS:
'$CC'
'$PCE'
.DISABLE DATA #0
.BB7:	.ASK B DO YOU WANT A FILE DESCRIPTION IN THE FILE HEADER
	.IFF <ESCAPE> .GOTO BB8
	.DISABLE QUIET
	;
	; THIS DISCRIPTION IS THE INTRODUCTORY DISCRIPTION OF THE FILE
	; IT SHOULD CONTAIN ASSEMBLY/COMPILATION INFORMATION AND
	; ANY OTHER INFORMATION OF INTEREST TO THE PERSON WHO MAINTAINS
	; YOUR PROGRAMS
	;
	.ENABLE QUIET
	.GOTO BB7
.BB8:	.IFF B .GOTO DD1
	.DISABLE QUIET
	;
	; TYPE <ESC> TO STOP INSERTING DESCRIPTION
	.ENABLE QUIET
	.DATA #0 '$SC'
	.DATA #0 '$CC' FILE DESCRIPTION
	.DATA #0 '$CC'
	.SETS SEP "	"
	.GOSUB INP
	.DATA #0 '$EC'
	.SETF DATAM
	.ASK B IS THIS A DATA MODULE
	.IFF B .GOTO DD1
	.IF $TYP = 4 .SETT DATAM
	.IF $TYP = 1 .SETT DATAM
.DD1:
.ENABLE DATA #0
'$CC'
'$CC'
'$FORM'
'$SC'
.DISABLE DATA #0
.GMOD:
	.IFT DATAM .CHAIN LB:[17,377]SDATA
.;	.IFT $GLOBL .SETS $NAMSZ "6"
	.ASKS [1:'$NAMSZ'] $TITL ENTRY NAME
	.ASKS M ONE LINE DESCRIPTION OF MODULE
	.DATA #0 '$CC'  **-'$TITL'-'M'
	.DATA #0 '$CC'
	.DISABLE QUIET
	;START TYPING DESCRIPTION OF MODULE. 
	;TYPE <ESC> TO ESCAPE
	.DISABLE QUIET
	.SETS SEP " "
	.GOSUB INP
.2B:	;ENTER INPUTS
.ENABLE DATA #0
'$CC'
'$CC' INPUTS:
.DISABLE DATA #0
	.SETS SEP "	"
	.GOSUB INP
.4B:
.ENABLE DATA #0
'$CC'
'$CC' OUTPUTS:
.DISABLE DATA #0
	.DISABLE QUIET
	;OUTPUTS
	.GOSUB INP
.6B:	
	;SIDE EFFECTS
	.ENABLE QUIET
.ENABLE DATA #0
'$CC'
'$CC' SIDE EFFECTS:
'$CC'
'$CC'    MODIFIED EXTERNALS
'$CC'
'$CC'    OTHER SIDE EFFECTS
.DISABLE DATA #0
	.GOSUB INP
.8B:	.SETS $SR1GS "'$SREGS'"
	.SETS $SR1GR "'$SREGR'"
	.IF $TYP = 2 .GOTO 2C
	.IF $TYP = 3 .GOTO 2C
	.IF $TYP = 5 .GOTO 2C
	.ASK $REGSY USING REGISTER SYMBOL STANDARD
	.ASK B STANDARD REGISTER USAGE
	.IFT B .GOTO 1C
	.DISABLE QUIET
	;REGISTER USAGE
	.ENABLE QUIET
	.SETS $SR1GR ""
	.SETS $SR1GS ""
.ENABLE DATA #0
'$CC'
'$CC' REGISTER USAGE:
.DISABLE DATA #0
.9B:	.GOSUB	INP
	.GOTO 2C
.1C:	
.ENABLE DATA #0
'$CC'
'$CC' STANDARD REGISTER USAGE
.DISABLE DATA
.2C:
.ENABLE DATA #0
'$CC'
'$EC'
.DISABLE DATA #0
	.ASK $MORM DOES THIS FILE HAVE ANOTHER MODULE
	.CHAIN LB:[17,377]SCONF'$TYP'
