Trailing-Edge
-
PDP-10 Archives
-
decuslib20-02
-
decus/20-0074/pub.mac
There are 2 other files named pub.mac in the archive. Click here to see a list.
;EXTERNAL PROCEDURE TO BE CALLED FROM ALGOL VER 6
;THE CALL IS PUB("NAME");
;ACTION: SAME AS IF .RUN PUB:NAME WAS GIVEN FROM TTY
TITLE PUB ROUTINE
ENTRY PUB
PUB: JRST PUB+4
EXP 0 ;TRACE BLOCK
1,,3 ;1 LETTER NAME
SIXBIT /PUB/
JSP 16,@%ALGDR##+1
EXP PUB+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 SYSBLK ;SET UP FOR RUN AGAIN
MOVE 3,[SIXBIT/LOGOUT/] ;BUT LOGOUT THIS TIME
MOVEM 3,NAME2 ;PUT INTO RUN BLOCK
JRST RUNP ;GO LOGOUT
HALT
RUNBLK: SIXBIT/PUB/ ;TAKE IT FROM PUB:
NAME: Z ;TO BE ENTERED FROM CALL ARGUMENT
Z ;NOT INTERESTED IN EXT
Z
Z
Z
SYSBLK: SIXBIT/SYS/ ;TAKE IT FROM SYS:
NAME2: 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