Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-02 - decus/20-0074/run.mac
There are 5 other files named run.mac in the archive. Click here to see a list.
;EXTERNAL PROCEDURE TO BE CALLED FROM ALGOL VER 6
;THE CALL IS RUN("NAME");
;ACTION: SAME AS IF .RUN NAME WAS GIVEN FROM TTY
TITLE	RUN ROUTINE
	ENTRY	RUN
RUN:	JRST	RUN+4
	EXP	0			;TRACE BLOCK
		1,,3			;3 LETTER NAME
	SIXBIT	/RUN/
	JSP	16,@%ALGDR##+1
	EXP	RUN+1			;ADDRESS OF TRACE BLOCK
	1,,6
	362000,,2			;NON-TYPE EXTERNAL PROCEDURE, 1 PARAM
	70540,,3			;STRING, FORMAL BY NAME
	JSP	16,@%ALGDR##+12
	XCT	3(15)
	MOVE	3,0			;GETSTRING ADDRESS
	HRRZ	1,1
;GET LENGTH OF ARGUMENT STRING IN 1
	CAIL	1,6			;SKIP IF LESS THAN 6
	MOVEI	1,6			;SET LENGTH TO 6 IF GREATER
WIND:	ILDB	2,FRPOIN		;TAKE A CHAR FROM THE STRING (REG 0 IS POINTER)
	SUBI	2,40			;CONV TO SIXBIT
	IDPB	2,TOPOIN		;STORE IN NAME
	SOJG	1,WIND			;LOOP MAX 6 TURNS
	HRRZI	RUNBLK			;SET UP FOR RUN
	CLOSE	2,0			;CLOSE THE LPT
RUNP:	CALLI	0,35			;RUN THE SPECIFIED PROGRAM
	OUTSTR	[ASCIZ/?CANNOT FIND SPECIFIED PROGRAM, LOGS OUT INSTEAD
/]
	HRRZI	RUNBLK			;SET UP FOR RUN AGAIN
	MOVE	3,[SIXBIT/LOGOUT/]	;BUT LOGOUT THIS TIME
	MOVEM	3,NAME			;PUT INTO RUN BLOCK
	JRST	RUNP			;GO LOGOUT
	HALT
RUNBLK:	SIXBIT/DSK/			;TAKE IT FROM DSK:
NAME:	Z				;TO BE ENTERED FROM CALL ARGUMENT
	Z				;NOT INTERESTED IN EXT
	Z
	Z
	Z
FRPOIN:	POINT	7,(3)			;TAKE FROM WHAT REG 3 POINTS TO
TOPOIN:	POINT	6,NAME			;AND PLACE IN NAME
;THE PROGRAM IS NEVER USED AGAIN-SO WE CAN DESTROY POINTERS
	END