Google
 

Trailing-Edge - PDP-10 Archives - ALGOL-20_1-29-82 - algol-sources/algstb.mac
There are 8 other files named algstb.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.
;
;
; WRITTEN BY K. NIST, C.M.U./ EDITED BY R. M. DE MORGAN

	SEARCH ALGPRM		; MAIN PARAMETER FILE

	IF1,<	.DIRECTIVE .OKOVL>
	SALL

%TITLE(ALGSTB,ALGOL COMPILER INITIAL SYMBOL TABLE)

	TWOSEG

	RELOC 400000

	MLON
SUBTTL BLOCK0 MODULE



;	THIS MODULE CONTAINS BLOCK0, WHICH IS THE INITIAL SYMBOL TABLE,
;	AND WHICH CONTAINS THE ENTRIES FOR THE LIBRARY PROCEDURES.  BLOCK 0
;	IS IN A DIFFERENT PART OF THE LOW SEGMENT FROM THE REST OF THE
;	SYMBOL TABLE, BUT IS PROPERLY LINKED IN WITH THE OTHER SO THAT
;	ONE CANNOT REALLY TELL THE DIFFERENCE.
;
;	THE MACRO "LIB" HAS BEEN PROVIDED TO SIMPLIFY PLACING THE ENTRIES IN
;	BLOCK 0.  ITS PARAMETERS ARE:
;
;
;	PARAMETER 1: (ALIAS1)	THE ALIAS NUMBER OF THE ROUTINE (WITHOUT THE
;				%-SIGN).
;
;
;	PARAMETER 2: (ALIAS2)	THE ALIAS NUMBER OF THE 2ND ENTRY POINT IF
;				THERE IS ONE (ALSO WITHOUT THE %-SIGN).
;				WHEN THERE IS NO 2ND ENTRY POINT, THIS
;				PARAMETER MUST BE DEFAULTED.
;
;
;	PARAMETER 3: (TYPE)	THE PROCEDURE TYPE, SPECIFIED AS:
;				    I  - INTEGER
;				    R  - REAL
;				    L  - LONG REAL
;				    BO - BOOLEAN
;				    ST - STRING
;				    N  - NON-TYPE
;
;
;	PARAMETER 4: (ACT)	THE NUMBER OF ACTUAL PARAMETERS.  IF THERE
;				CAN BE A VARIABLE NUMBER OF ACTUALS, ENTER
;				A "V" FOR THIS PARAMETER.
;
;
;	PARAMETER 5: (N1)	1ST 5 CHARACTERS OF NAME.
;	PARAMETER 6: (N2)	NEXT 6 CHARACTERS OF NAME.
;	PARAMETER 7: (N3)	NEXT 6 CHARACTERS OF NAME.
;
;				ONLY LETTERS AND DIGITS ARE ALLOWED, NOT SPACES.
;				ANY OF THESE PARAMETERS SHOULD BE OMITTED
;				IF IT WOULD HAVE BEEN NULL.  ALL SPECIFIED
;				PARAMETERS *MUST* BE FOLLOWED IMMEDIATELY
;				BY A COMMA, INCLUDING THE LAST PARAMETER.
	INTERN	ZBOOL		; ADDR OF ENTRY FOR BOOL
	INTERN	ZINT		; ADDR OF ENTRY FOR INT
	INTERN	ZABS		; ADDR OF ENTRY FOR ABS
	INTERN	ZSIGN		; ADDR OF ENTRY FOR SIGN
	INTERN	ZENTIE		; ADDR OF ENTRY FOR ENTIE
	INTERN	PRASE
	INTERN	PRLIB

	SALL
	DEFINE	ENTR (IND)
	<
	LLINK==HT'IND
	HT'IND==CLOC-XB0+BLOCK0>


	DEFINE	ENTR1 (NAME,IND)
	<
	NAME'IND>


	DEFINE	ENTR2 (NAME,IND,VAL)
	<
	NAME'IND==VAL>






	DEFINE	INVERT (NX,NXVAL)
	<
	IFNB	<NX>,<
	NY==SIXBIT/NX/
	SHIFTS==0
	NYVAL==0
	INV INV INV INV INV INV
	NXVAL==<NYVAL>_<SHIFTS>> >



	DEFINE	INV
	<
	CCHAR==NY&77
	IFE	CCHAR, <
	SHIFTS==SHIFTS+6 >
	IFN	CCHAR, <
	CCHAR==<CCHAR+40>&77
	NYVAL==<<NYVAL>_<6>>!CCHAR
	CCC==CCC+1 >
	NY==<NY>_<-6> >
	HASH==-1
	REPEAT	200,
<	HASH==HASH+1
	ENTR2	HT,\HASH,0
>

; THE WEIRD EXPRESSIONS IN LIB ARE TO GET ROUND A BUG IN MACRO-10!!!

	DEFINE	LIB (ALIAS1,ALIAS2,TYPE,ACT,N1,N2,N3)
<
	CCC==-1
	LLINK==0
	CLOC==.
	ENTR2	A1.,\AL1,<<RADIX50 00,%'ALIAS1>&037777777777>
	AL1==AL1+1

	IFNB	<ALIAS2>,<
	ENTR2	A2.,\AL2,<<RADIX50 00,%'ALIAS2>&037777777777>
	AL2==AL2+1>

	IINDEX==IINDEX+1
	INVERT	N1,N1VAL
	INVERT	N2,N2VAL
	INVERT	N3,N3VAL

	IFNB	<N1>,<
	A==<N1VAL+CCC>_<-11>
	B==N1VAL&777
	TTEMP==B*D/1000+A*D+B*C+A*C*1000
	HASH==<<TTEMP>_<-^D26>>&177
	ENTR \HASH>

								XWD	EXT,LLINK
								XWD	TYPE+ACT,0
	IFB	<N1>,<
								XWD	0,0>
	IFNB	<N1>,<
								N1VAL+CCC>
	IFNB	<N2>,<
								N2VAL>
	IFNB	<N3>,<
								N3VAL>
	IFN	EXT, <
								XWD	0,0
								XWD	0,0
>>
	AL1==0
	AL2==0
	V==-1
	C==647
	D==327
	IINDEX==0

B0LIST::XWD	BLOCK0,XSYMHT+200-XB0


	I==$I+$EXT+$PRO+$DEC+1
	R==$R+$EXT+$PRO+$DEC+1
	L==$LR+$EXT+$PRO+$DEC+1
	BO==$B+$EXT+$PRO+$DEC+1
	ST==$S+$EXT+$PRO+$DEC+1
	N==$N+$EXT+$PRO+$DEC+1

	EXT==0

	XALL
XB0:
;	GROUP 1:	BOOL, INT, ABS, SIGN, AND ENTIER.  THIS ORDER
;			CANNOT BE CHANGED.



	LIB	226,,BO,1,BOOL,			; BOOL
	LIB	225,,I,1,INT,			; INT
	LIB	222,,R,1,ABS,			; ABS
	LIB	223,,I,1,SIGN,			; SIGN
	LIB	224,,R,1,ENTIE,R,		; ENTIER
	EXT==400000

XPRASE:
;	GROUP 2:	STANDARD ALGOL LIBRARY PROCEDURES.  EACH MUST
;			HAVE TWO ENTRY POINTS.  THE ORDER IN WHICH PROCEDURES
;			ARE PLACED IN THIS GROUP IS NOT IMPORTANT.



	LIB	100,200,R,1,SIN,		; SIN
	LIB	101,201,R,1,COS,		; COS
	LIB	102,202,R,1,ARCTA,N,		; ARCTAN
	LIB	103,203,R,1,SQRT,		; SQRT
	LIB	104,204,R,1,EXP,		; EXP
	LIB	105,205,R,1,LN,			; LN
	LIB	106,206,R,1,TAN,		; TAN
	LIB	107,207,R,1,ARCSI,N,		; ARCSIN
	LIB	110,210,R,1,ARCCO,S,		; ARCCOS
	LIB	111,211,R,1,SINH,		; SINH
	LIB	112,212,R,1,COSH,		; COSH
	LIB	113,213,R,1,TANH,		; TANH
	LIB	114,214,L,1,LSIN,		; LSIN
	LIB	115,215,L,1,LCOS,		; LCOS
	LIB	116,216,L,1,LARCT,AN,		; LARCTAN
	LIB	117,217,L,1,LSQRT,		; LSQRT
	LIB	120,220,L,1,LEXP,		; LEXP
	LIB	121,221,L,1,LLN,		; LLN
	EXT==0

XPRLIB:
;	GROUP 3:	UNNAMED LIBRARY PROCEDURES.  THE ALGOL USER CANNOT
;			ACCESS THESE ENTRIES BY NAMING THEM IN HIS
;			PROGRAM.  THESE PROCEDURES ARE IN BLOCK 0 ONLY
;			FOR INTERNAL REASONS.  THE STRICT ORDERING OF THESE
;			ENTRIES IS IMPORTANT.


	LIB	1,,R,1,				; POWER1
	LIB	2,,R,1,				; POWER2
	LIB	3,,R,1,				; POWER3
	LIB	4,,R,1,				; POWER4
	LIB	5,,R,1,				; POWER5
	LIB	7,,R,1,				; IR
	LIB	10,,L,1,			; ILR
	LIB	12,,I,1,			; RI
	LIB	13,,L,1,			; RLR
	LIB	15,,I,1,			; LRI
	LIB	16,,R,1,			; LRR
	LIB	14,,L,1,			; ENTIEL
	LIB	17,,L,1,			; DFAD0
	LIB	20,,L,1,			; DFSB0
	LIB	21,,L,1,			; DFMP0
	LIB	22,,L,1,			; DFDV0
	LIB	23,,L,1,			; RDFSB0
	LIB	24,,L,1,			; RDFDV0
	LIB	25,,L,1,			; DFAD3
	LIB	26,,L,1,			; DFSB3
	LIB	27,,L,1,			; DFMP3
	LIB	30,,L,1,			; DFDV3
	LIB	31,,L,1,			; RDFSB3
	LIB	32,,L,1,			; RDFDV3
	LIB	33,,L,1,			; DFAD6
	LIB	34,,L,1,			; DFSB6
	LIB	35,,L,1,			; DFMP6
	LIB	36,,L,1,			; DFDV6
	LIB	37,,L,1,			; RDFSB6
	LIB	40,,L,1,			; RDFDV6
	LIB	41,,L,1,			; DFAD9
	LIB	42,,L,1,			; DFSB9
	LIB	43,,L,1,			; DFMP9
	LIB	44,,L,1,			; DFDV9
	LIB	45,,L,1,			; RDFSB9
	LIB	46,,L,1,			; RDFDV9
XPRAN:
;	GROUP 4:	ALL OTHER LIBRARY PROCEDURES.  THESE ROUTINES
;			MUST HAVE 1 ENTRY POINT.  THE ORDERING OF THESE
;			ENTRIES IS NOT IMPORTANT.


	LIB	300,,I,1,DIM,			; DIM
	LIB	301,,I,2,LB,			; LB
	LIB	302,,I,2,UB,			; UB
	LIB	303,,I,V,IMIN,			; IMIN
	LIB	304,,I,V,IMAX,			; IMAX
	LIB	305,,R,V,RMIN,			; RMIN
	LIB	306,,R,V,RMAX,			; RMAX
	LIB	307,,L,V,LMIN,			; LMIN
	LIB	310,,L,V,LMAX,			; LMAX
	LIB	311,,I,3,GFIEL,D,		; GFIELD
	LIB	312,,N,4,SFIEL,D,		; SFIELD
	LIB	314,,ST,V,COPY,			; COPY
	LIB	315,,N,V,TRAP			;[206] TRAP
	LIB	316,,I,0,INCHA,N,		; INCHAN
	LIB	317,,I,0,OUTCH,AN,		; OUTCHAN
	LIB	320,,ST,2,NEWST,RING,		; NEWSTRING
	LIB	321,,I,1,LENGT,H,		; LENGTH
	LIB	322,,N,1,DELET,E,		; DELETE
	LIB	325,,ST,V,CONCA,T,		; CONCAT
	LIB	326,,I,1,SIZE,			; SIZE
	LIB	327,,N,1,TRACE,			; TRACE
	LIB	401,,N,1,INSYM,BOL,		; INSYMBOL
	LIB	402,,N,1,OUTSY,MBOL,		; OUTSYMBOL
	LIB	403,,N,1,NEXTS,YMBOL,		; NEXTSYMBOL
	LIB	404,,N,0,SKIPS,YMBOL,		; SKIPSYMBOL
	LIB	405,,N,0,BREAK,OUTPUT,		; BREAKOUTPUT
	LIB	406,,N,V,SPACE,			; SPACE
	LIB	407,,N,V,TAB,			; TAB
	LIB	410,,N,V,NEWLI,NE,		; NEWLINE
	LIB	411,,N,V,PAGE,			; PAGE
	LIB	412,,N,V,READ,			; READ
	LIB	413,,N,1,WRITE,			; WRITE
	LIB	414,,N,V,PRINT,			; PRINT
	LIB	415,,N,1,READO,CTAL,		; READOCTAL
	LIB	416,,N,1,PRINT,OCTAL,		; PRINTOCTAL
	LIB	417,,N,V,INPUT,			; INPUT
	LIB	420,,N,V,OUTPU,T,		; OUTPUT
	LIB	421,,N,1,SELEC,TINPUT,		; SELECTINPUT
	LIB	422,,N,1,SELEC,TOUTPU,T,	; SELECTOUTPUT
	LIB	423,,N,1,RELEA,SE,		; RELEASE
	LIB	424,,N,V,OPENF,ILE,		; OPENFILE
	LIB	425,,N,1,CLOSE,FILE,		; CLOSEFILE
	LIB	426,,N,0,TRANS,FILE,		; TRANSFILE
	LIB	427,,N,1,BACKS,PACE,		; BACKSPACE
	LIB	430,,N,1,ENDFI,LE,		; ENDFILE
	LIB	431,,N,1,REWIN,D,		; REWIND
	LIB	432,,BO,1,IOCHA,N,		; IOCHAN
	LIB	433,,I,1,INLIN,E,		; INLINE
	LIB	434,,N,V,CALL,			; CALL
	LIB	435,,I,V,ICALL,			; ICALL
	LIB	436,,R,V,RCALL,			; RCALL
	LIB	437,,L,V,DCALL,			; DCALL
	LIB	440,,BO,V,LCALL,		; LCALL

	LIB	441,,I,1,INFO,			; INFO
	LIB	442,,ST,0,FDATE,		; FDATE
	LIB	443,,ST,0,VDATE,		; VDATE
	LIB	444,,ST,0,TIME,			; TIME
	;
	; Edit(1011)  Establish aliases for RAN,TRACEON & TRACEOFF
	;
	LIB	445,,I,0,RAN,			; RAN
	LIB	445,,I,0,RAND,			; [E1011] = RAND
	LIB	446,,N,1,SETRA,N,		; SETRAN
	LIB	447,,I,0,SAVRA,N,		; SAVRAN
	LIB	455,,N,0,TRACE,ON,		; TRACEON
	LIB	455,,N,0,ONTRA,CE,		; [E1011] = ONTRACE
	LIB	456,,N,0,TRACE,OFF,		; TRACEOFF
	LIB	456,,N,0,OFFTR,ACE,		; [E1011] = OFFTRACE
	LIB	461,,N,0,PAUSE,			; PAUSE
	LIB	462,,N,1,DUMP,			; DUMP
	LIB	450,,N,V,F10CA,LL,		; F10CALL
	LIB	451,,I,V,F10IC,ALL,		; F10ICALL
	LIB	452,,R,V,F10RC,ALL,		; F10RCALL
	LIB	453,,L,V,F10DC,ALL,		; F10DCALL
	LIB	454,,BO,V,F10LC,ALL,		; F10LCALL

XB0END:				; END OF BLOCK 0

	SALL
XSYMHT:
	HASH==-1
	REPEAT	200,
<
	HASH==HASH+1
	ENTR1	HT,\HASH
>
	XWD	0,0

ATABLE::			; TABLE OF LIBRARY ROUTINE ALIAS NAMES

	ALC==-1
	REPEAT AL1,
<
	ALC==ALC+1
	ENTR1	A1.,\ALC
>
AT2==:.-5				; TABLE OF 2-ENTRY LIBRARY ALIAS NAMES

	ALC==-1
	REPEAT AL2,
<
	ALC==ALC+1
	ENTR1	A2.,\ALC
>
	RELOC

BLOCK0::
ZBOOL:	BLOCK	3
ZINT:	BLOCK	3
ZABS:	BLOCK	3
ZSIGN:	BLOCK	3
ZENTIE:	BLOCK	4
PRASE:
	BLOCK	XPRLIB-XPRASE
PRLIB:
	BLOCK	XPRAN-XPRLIB
PRAN:
	BLOCK	XB0END-XPRAN
B0END::
SYMHT::	BLOCK	200		; SYMBOL TABLE HASH TABLE (**MUST FOLLOW BLOCK0**)

	RELOC
	END