.; [202,1]ALE.CMD MAO 13-MAY-80 .; .; INDIRECT MCR FILE TO TRANSLATE AND ASSEMBLE ALECS MODULES .; .; CALLING SEQUENCE: @[202,1]ALE NAME MACSW ALESW .; WHERE NAME=FILE NAME (WITHOUT EXTENSION) FOR ALECS INPUT FILE. .; MACSW=ANY MAC SWITCHES TO BE USED (MAY BE BLANK). .; IF ALECS SWITCHES ARE TO BE GIVEN WITHOUT ANY .; MAC SWITCHES, PUT A POUND SIGN (#) HERE. .; ALESW=ANY ALECS SWITCHES TO BE USED (MAY BE BLANK). .; .; IF NAME IS NOT GIVEN (EG. @ALE), INFORMATION IS PROMPTED FOR .; UNTIL A ^Z IS GIVEN OR A FATAL ERROR OCCURS. .; IF NAME IS GIVEN, THE GIVEN MODULE IS PROCESSED AND ALE.CMD EXITS. .; .; REVISIONS .; 20-MAY-80 (MAO) CHECK SW FOR VALIDITY; FIX SYNTAX ERROR FOR ERROR EXITS. .; 04-MAR-83 (MAO) ALLOW ALECS SWITCHES; USE # FOR MISSING MAC SWITCHES. .; 13-AUG-84 (MAO) PURGE .OBJ & .ALL INSTEAD OF DELETING. .; .; .ENABLE SUBSTITUTION .SETS POUND "#" .SETS BLANK "" .SETS SLASH "/" .SETS FU "FU" ;ALECS /FU .SETS MFU "-FU" .SETS SP "SP" ;ALECS /SP .SETS MSP "-SP" .SETS CO "CO" ;ALECS /CO .SETS MCO "-CO" .; .IF P1 EQ BLANK .GOTO 10$ ;MUST PROMPT FOR INPUT .; .SETT WASCMD ;INPUT WAS IN COMMAND LINE .SETS NAM P1 .SETS MACSW P2 .SETS ALESW P3 .GOTO TSTMAC .; .10$: .SETF WASCMD ;NO COMMAND LINE GIVEN, PROMPT .; .QUERY: .; .ASKS NAM GIVE ALE FILE NAME (^Z TO EXIT) .ASKS MACSW GIVE MAC SWITCHES .ASKS ALESW GIVE ALE SWITCHES .; .TSTMAC: .IF POUND EQ MACSW .SETS MACSW BLANK ;Just a space holder .; .IF BLANK EQ MACSW .OR .IF SLASH EQ MACSW[1:1] .GOTO TSTALE .; ; FIRST CHARACTER OF MAC SWITCH NOT A "/" .EXIT 4 .; .TSTALE: .SETS INPFU BLANK ;Assume no /FU given .SETS INPSP BLANK ;Assume no /SP given .SETS INPCO BLANK ;Assume no /CO given .; .IF BLANK EQ ALESW .GOTO ACT ;Nothing to parse .; .PARSE ALESW "/" S1 S2 S3 S4 .; .IF BLANK EQ S1 .GOTO 20$ .; .; The way PARSE works, S1 will be blank if first char is a slash ; First character of ALE switch not a "/" .EXIT 4 .20$: .; Evaluate each switch .GOSUB EVSW 'S2' .GOSUB EVSW 'S3' .GOSUB EVSW 'S4' .; .ACT: ALE 'NAM''INPFU','NAM'/-SP'INPSP'='NAM''INPCO' .IF GT 1 .EXIT .; MAC 'NAM','NAM'/-SP='NAM''MACSW' .IF GT 1 .EXIT .; PIP 'NAM'.ALL='NAM'.LST/AP PIP 'NAM'.MAC;*,'NAM'.LST;*/DE PIP 'NAM'.OBJ,'NAM'.ALL/PU .; .IFF WASCMD .GOTO QUERY ;IF WAS NO CMD LINE, PROMPT FOR MORE .EXIT 1 .; .EVSW: .; .; SUBROUTINE EVSW (SWITCH STRING) .; .; Evaluate which FLECS/ALECS switch was given. .; The argument is passed in local symbol COMMAN without the leading slash. .; .IF FU NE COMMAN[1:2] .AND .IF MFU NE COMMAN[1:3] .GOTO 30$ .SETS INPFU "/"+COMMAN ;Some form of /FU given .GOTO 60$ .30$: .IF SP NE COMMAN[1:2] .AND .IF MSP NE COMMAN[1:3] .GOTO 40$ .SETS INPSP "/"+COMMAN ;Some form of /SP given .GOTO 60$ .40$: .IF CO NE COMMAN[1:2] .AND .IF MCO NE COMMAN[1:3] .GOTO 50$ .SETS INPCO "/"+COMMAN ;Some form of /CO given .GOTO 60$ .50$: .IF BLANK EQ COMMAN .GOTO 60$ ; Unknown ALECS switch /'COMMAN' .EXIT 4 .; .60$: .RETURN .; .; END OF FILE ALE.CMD