Google
 

Trailing-Edge - PDP-10 Archives - ALGOL-20_29Jan82 - algol-sources/algsys.mac
There are 8 other files named algsys.mac in the archive. Click here to see a list.
;
;
;COPYRIGHT (C) 1975,1981,1982 BY
;DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
;
;
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
;ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
;INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
;COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
;OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
;TRANSFERRED.
;
;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
;AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
;CORPORATION.
;
;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
;SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
;
;
; THIS FILE MUST BE COMPILED AFTER ALGPRM, AND BEFORE ALGLIB

	SEARCH	ALGPRM		; SEARCH MAIN PARAMETER FILE
	SALL

%UNIVERSAL(ALGSYS,ALGOL LIBRARY PARAMETER FILE)
SUBTTL	LIBRARY MACROS

	; %ENTER - GENERATES ENTRY %NNNL AS MANY TIMES AS NEEDED

	DEFINE	%ENTER(ALIAS),<
	IRP	ALIAS,<ENTRY	%'ALIAS'L>>


	; LIBENT - GENERATES POST-MORTEM BLOCK, POINTER TO IT & PARAM CALL
	;  FOR LIBRARY ROUTINES THAT LOOK LIKE GENUINE ALGOL PROCEDURES
	;
	; CALL - LIBENT(ALIAS-#,NAME,V)
	;
	; WHERE:	ALIAS-# IS THE 1-,2- OR 3-DIGIT ALIAS NUMBER
	;		(WHICH AGREES WITH THE LIB MACRO IN ALGCON)
	;		FROM WHICH THE PROCEDURE'S ENTRY-POINT NAME IS FORMED,
	;
	;		NAME IS THE SIXBIT NAME OF THE PROCEDURE:
	;		THIS IS DUMPED INTO THE POST-MORTEM BLOCK
	;		FOR THE RUN-TIME TRACE PACKAGE TO TYPE OUT.
	;
	;		V  IS OPTIONAL. IF PRESENT, THE PROCEDURE HAS A
	;		VARIABLE NUMBER OF PARAMETERS (SEE, FOR EXAMPLE, IMAX)
	;		AND V WILL BE THE OFFSET ON THE LOCAL STACK WHERE PARAM
	;		WILL STORE THE NUMBER OF ACTUALS.
	;
	; THE MACRO GENERATES EVERYTHING THAT IS NEEDED FOR PROCEDURE ENTRY,
	;   EXCEPT FOR THE SEARCH ALGPRM,ALGSYS WHICH MUST PRECEDE IT.
	;   THE JSP AX,PARAM  OR  PAR0 IS GENERATED, AND THE P.M. BLOCK
	;   POINTER, BUT NOT THE DESCRIPTOR-WORDS THAT FOLLOW.  ENTRY
	;   STATEMENTS ARE GENERATED, AND THE NAME IS PUT INTO THE CREF FOR
	;   EASE OF FINDING THE PROCEDURE IN A LARGE LIBRARY-LISTING.

	DEFINE	LIBENT(ALIAS,NAME,V,%X) <
	ENTRY	%'ALIAS'L
	IFNDEF	%ALGDR,<
	EXTERNAL	%ALGDR
	SALL
	%SUBTTL(ALGLIB,ALGOL LIBRARY)
>
%X:	Z			;; PROFILE WORD
	ZZZ==1			;; ALLOW 1 FOR THE *
	IRPC	NAME,<ZZZ==ZZZ+1>;; COUNT BYTES
	XWD	<ZZZ/6+1>,ZZZ	;; WORDS,,BYTES
	SIXBIT\NAME'*\
	IFE	<<ZZZ/6>*6-ZZZ>,<
	Z			;; SIXBITZ WORD !
	>
	IFNB	<V>, <
	XWD	DL,V		;; VARIABLE # PARAMS
NAME:				;; FOR CREF
LABEL(ALIAS):	JSP	AX,PAR0>
	IFB	<V>, <
NAME:				;; FOR CREF
LABEL(ALIAS):	JSP	AX,PARAM>
	EXP	%X		;; POINTER TO PMB BLOCK
	PURGE	NAME		;; JUST IN CASE
>
	; STDENT - DOES THE SAME THINGS AS LIBENT, FOR
	; STANDARD FUNCTIONS (LIKE SIN) WHICH DON'T CALL
	; PARAM. IT MAKES A P.M. BLOCK, AND PLANTS A CALL
	; TO THE OTS ROUTINE TRSTD WHICH DOES TRACING
	; IF REQUIRED.
	;
	; CALL - STDENT(ALIAS-#,NAME)
	;
	; WHERE THE PARAMETERS ARE AS FOR LIBENT

	DEFINE	STDENT(ALIAS,NAME,%X) <
	ENTRY	%'ALIAS'L

	IFNDEF	%ALGDR,<
	EXTERNAL	%ALGDR
	SALL
	%SUBTTL(ALGLIB,ALGOL LIBRARY)
>

%X:	Z			;; PROFILE WORD
	ZZZ==1
	IRPC	NAME,<ZZZ==ZZZ+1>;; COUNT CHARS IN NAME.
	XWD	<ZZZ/6+1>,ZZZ	;; WORDS,,CHARS
	SIXBIT\NAME'*\
	IFE	<<ZZZ/6>*6-ZZZ>,<
	Z			;; SIXBITZ WORD !
>

NAME:				;; FOR CREF
LABEL(ALIAS):			;; ENTRY
	PUSHJ	SP,TRSTD
	EXP	%X
	PURGE	NAME
>

	; LABEL MACRO - GENERATES %NNNL

	DEFINE LABEL(M),<%'M'L>

	; EXTLAB MACRO - GENERATES EXTERN %NNNL AS MANY TIMES AS NEEDED

	DEFINE EXTLAB(M),<
	IRP	M,<EXTERN %'M'L>>
SUBTTL ALGOTS ROUTINE ADDRESS MACROS

	DEFINE R(A,B)
	<DEFINE B
	<%ALGDR+A>>		; [234] REMOVE "@"

	DEFINE PORTAL(A)
	<Q=Q+1
	R \Q,A>
; WHEN THIS IS CHANGED, DEFINITIONS AT OR ABOUT LINE 974 OF
; ALGMAC MAY HAVE TO BE CHANGED ALSO.

	DEFINE ALGDIR <
	Q=-1

	PORTAL	INITIA		; [234] 0- INITIALIZATION
	PORTAL	PARAM		; [234] 1- PROCEDURE PARAMETER ORGANIZATION
	PORTAL	PAR0		; [234] 2- DITTO, VARIABLE LENGTH
	PORTAL	GOLAB		; [234] 3- GOTO LABEL
	PORTAL	ARRAY		; [234] 4- ARRAY LAYOUT
	PORTAL	OARRAY		; [234] 5- OWN ARRAY LAYOUT
	PORTAL	CHKARR		; [234] 6- CHECK ARRAY SUBSCRIPTS
	PORTAL	COMPAR		; [234] 7- COMPARE STRINGS
	PORTAL	PBYTE		; [234] 10-BYTE POINTER
	PORTAL	BLKBEG		; [234] 11-BLOCK BEGIN
	PORTAL	BLKEND		; [234] 12-BLOCK END
	PORTAL	CPYSTR		; [234] 13-COPY STRING
	PORTAL	CPYARR		; [234] 14-COPY ARRAY
	PORTAL	GETOWN		; [234] 15-GET OWN SPACE
	PORTAL	GETCLR		; [234] 16-GET OWN SPACE - ZEROED
	PORTAL	MONIT		; [234] 17-MONITOR
	PORTAL	MONIT0		; [234] 20-MONITOR WITH BREAK
	PORTAL	RDOCT		; [234] 21-READ OCTAL WORD
	PORTAL	PROCT		; [234] 22-PRINT OCTAL HALFWORD
	PORTAL	INBYTE		; [234] 23-INPUT BYTE
	PORTAL	OUBYTE		; [234] 24-OUTPUT BYTE
	PORTAL	NXTBYT		; [234] 25-NEXT INPUT BYTE (LOOK AHEAD)
	PORTAL	BRKBYT		; [234] 26-BREAK OUTPUT
	PORTAL	INCHAR		; [234] 27-READ CHARACTER
	PORTAL	OUCHAR		; [234] 30-OUTPUT CHARACTER
	PORTAL	BRKCHR		; [234] 31-BREAKCHARACTER
	PORTAL	READ.		; [234] 32-READ
	PORTAL	PRINT.		; [234] 33-PRINT
	PORTAL	SELIN		; [234] 34-SELECT INPUT
	PORTAL	SELOUT		; [234] 35-SELECT OUTPUT
	PORTAL	INPT		; [234] 36-INPUT
	PORTAL	OUTPT		; [234] 37-OUTPUT
	PORTAL	RELESE		; [234] 40-RELEASE
	PORTAL	OPFILE		; [234] 41-OPEN FILE
	PORTAL	CLFILE		; [234] 42-CLOSE FILE
	PORTAL	XFILE		; [234] 43-TRANSFER FILE
	PORTAL	BSPACE		; [234] 44-BACKSPACE
	PORTAL	ENFILE		; [234] 45-ENDFILE
	PORTAL	REWND.		; [234] 46-REWIND
	PORTAL	STRASS		; [234] 47-STRING ASSIGNMENT
	PORTAL	FUNCT		; [234] 50-OVERLAY HANDLER
	PORTAL	TRLPRT		; [234] 51-PRINT TRACE LIST
	PORTAL	TRLAB		; [234] 52-TRACE LABEL ENTRY
	PORTAL	TRSTD		; [234] 53-TRACE STANDARD FUNCTION
	PORTAL	STRDEC		; [234] 54-DECLARE STRINGS
	PORTAL	DDDUMP		; [234] 55-DDT DUMP ROUTINE.
	PORTAL	INCHR0		; [234] [E145] 56-READ CHARACTER WITH EOF LEGAL

>
	ALGDIR			; CALL ALGDIR MACRO

	PURGE	PORTAL		; KILL PORTAL MACRO
SUBTTL	VARIOUS DEFINITIONS

; GETTAB NUMBERS

.GTCNF==11			; CONFIGURATION TABLE
%CNYER==56			; YEAR
%CNMON==57			; MONTH
%CNDAY==60			; DAY
%CNHOR==61			; HOUR
%CNMIN==62			; MINUTE
%CNSEC==63			; SECOND

	END