Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap2_198111 - decus/20-0074/r.mac
There are 2 other files named r.mac in the archive. Click here to see a list.
;EXTERNAL PROCEDURE TO BE CALLED FROM ALGOL VER 6
;THE CALL IS R("NAME");
;ACTION: SAME AS IF .R NAME WAS GIVEN FROM TTY
TITLE	R ROUTINE
	ENTRY	R
R:	JRST	R+4
	EXP	0			;TRACE BLOCK
		1,,1			;1 LETTER NAME
	SIXBIT	/R/
	JSP	16,@%ALGDR##+1
	EXP	R+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:	RUN	0,			;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/SYS/			;TAKE IT FROM SYS:
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