Trailing-Edge
-
PDP-10 Archives
-
tops20tools_v6_9-jan-86_dumper
-
tools/compil2/execute.com
There are 2 other files named execute.com in the archive. Click here to see a list.
$ ! EXECUTE.COM - COMPILE and LOAD and RUN program
$ SAVE_VERIFY := 'COMMAND$DEBUG ! COMMAND$DEBUG == 1 to see more
$ SAVE_VERIFY = 'F$VERIFY( SAVE_VERIFY .AND. F$VERIFY( ) ) ! economize logs
$ COMMAND$DEBUG := 'COMMAND$DEBUG
$ GOTO START ! even in VERIFY mode, economize logging
$ ! This command COMPILE's and LOAD's programs, and then RUN's the result.
$ ! See COMPILE.COM and LOAD.COM to see how compiler and linker time is saved.
$ ! This emulates the TOPS-10/TOPS-20 compile-class command EXECUTE.
$ !
$ ! To use:
$ ! $ @EXECUTE progid
$ ! or:
$ ! $ @EXECUTE progid1,progid2,...,progidn
$ ! or:
$ ! $ @EXECUTE @progid.lst
$ ! In the latter case, all the progid's in the indirect file are
$ ! conditionally LOADed.
$ !
$ ! REVISION HISTORY
$ !
$ ! 21-Sep-84 PFK scarfed LOAD.COM for skeleton of this command
$ ! Peter F. Klammer
$ !
$ ! 21-Sep-84 PFK p2 LOAD parameter: EXECUTE call, then no extra COMPILE
$ !
$ ! 2-Oct-84 PFK p2 parameter: /COMPILE forced compile, passed on.
$ !
$ ! 2-Oct-84 PFK for debugging only, COMMAND$DEBUG == 1;
$ ! for full trace, COMMAND$DEBUG == 1 and SET VERIFY;
$ ! SET VERIFY alone, default for batch, is suppressed
$ !
$ ! 11-OCT-1984 PFK Oops! at RUN:, run EXENAME, not P1
$ !
$ ! 18-OCT-1984 PFK before RUN, define SYS$INPUT back to SYS$COMMAND
$ !
$ ! END REVISION HISTORY
$START:
$ STATUS = 1
$ ON CONTROL_Y THEN GOTO ABORT
$ ON ERROR THEN GOTO ABORT
$ PV := 'COMPILE$LOAD$EXECUTE$FILESPEC ! was there any previous value?
$ IF PV .EQS. "" THEN COMPILE$LOAD$EXECUTE$FILESPEC == "" ! global now exists
$TRYP1:
$ IF p1 .EQS. "" THEN p1 = COMPILE$LOAD$EXECUTE$FILESPEC ! {RET} given, use global memory
$ IF p1 .NES. "?" THEN GOTO GETP1
$ WRITE SYS$OUTPUT "$ EXECUTE (programs) ?"
$ TYPE SYS$INPUT:
PROGID name of a source and object module to conditionally LINK
or,
PROGI1,PROGI1,... list of names, for PROGI1.EXE
or,
@PROGID.LST filename of a list of modules, for PROGID.EXE
or,
{RETURN} remembers previous COMPILE/LOAD/EXECUTE parameter
$ p1 = ""
$GETP1:
$ IF p1 .NES. "" THEN GOTO GOTP1 ! if no parameter yet, keep trying
$ INQUIRE/NOPUNCT p1 "$ EXECUTE (programs) "
$ GOTO TRYP1
$GOTP1:
$ COMPILE$LOAD$EXECUTE$FILESPEC == p1 ! global now set
$ COMPILE 'p1 'p2 ! first get current .OBJ's
$ LOAD 'p1 EXECUTE$CALLING ! get current .EXE
$ LINE = p1
$ IF F$LOCATE( "@", LINE ) .NE. F$LENGTH( LINE ) THEN -
LINE = F$EXTRACT( 0, F$LOCATE( ".", LINE ), LINE )
$ LINE = LINE - "@"
$GETEXENAME:
$ IF COMMAND$DEBUG THEN WRITE SYS$OUTPUT " [EXECUTE: now line has:''LINE']"
$ EXENAME = F$EXTRACT(0,F$LOCATE(",",LINE),LINE)
$ IF COMMAND$DEBUG THEN WRITE SYS$OUTPUT " [EXECUTE: run module is:''EXENAME']"
$GOTEXE:
$RUN:
$ WRITE SYS$OUTPUT "$ RUN ''EXENAME'"
$ DEFINE/USER_MODE SYS$INPUT SYS$COMMAND:
$ RUN 'EXENAME'
$ GOTO END
$ABORT:
$ SET NOCONTROL=Y ! be sure control-Y trapping cleared
$ SET CONTROL=Y
$ STATUS = 4 + %X10000000 ! failure + message already shown
$END:
$ CLOSE/ERROR=IGNORE AT
$IGNORE:
$ SAVE_VERIFY := 'F$VERIFY(SAVE_VERIFY)'
$ EXIT STATUS