Google
 

Trailing-Edge - PDP-10 Archives - AP-D608C-SB - algprm.mac
There are 8 other files named algprm.mac in the archive. Click here to see a list.
;
;
;
;
;
;
;	COPYRIGHT (C) 1975,1976,1977,1978
;	DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
;
;
;	THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A
;	SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY 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 EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO
;	AGREES TO THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE
;	SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.
;
;	THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT
;	NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
;	EQUIPMENT CORPORATION.
;
;	DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
;	SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
;
;SUBTTL MAIN ASSIGNMENTS

; COPYRIGHT 1971,1972,1973,1974 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

; THIS FILE MUST BE COMPILED BEFORE ALL OTHER ALGOL FILES

	SALL

	MAJVNO==10		; MAJOR VERSION NUMBER
	MINVNO==1		; MINOR VERSION NUMBER
	EDTNO==145		; EDIT NUMBER
	VERNO==<MAJVNO>B11+<MINVNO>B17+EDTNO

	DEFINE %TEXT(F,VERNO)
<	DEFINE %'F(A,B)
<F A - B, VERNO, EUROPEAN SOFTWARE ENGINEERING, SEP-74
>>

	%TEXT(UNIVERSAL,10A(145))
	%TEXT(TITLE,10A(145))
	%TEXT(SUBTTL,10A(145))

%UNIVERSAL(ALGPRM,ALGOL PARAMETER FILE)

	KA10==0			; PROCESSOR SWITCHES 
	KI10==1			; FOR LIBRARY ONLY

; PDP-10 (KA10) VERSION: PROC==KA10
; PDP-10 (KI10) VERSION: PROC==KI10

	IFNDEF PROC, <
	PROC==KI10>		; DEFAULT: PDP-10 (KI10) VERSION
	IFNDEF FTDDT, <FTDDT==-1>
	IFNDEF	FTSYM,<FTSYM==1>	; 1 to make compiler produce 1044 blocks by default.
	IFE FTDDT,<FTSYM==0>		; Lets not be stupid, folks !
	IFNDEF FTSTATS, <FTSTATS==0> ; 1 TO PRODUCE COMPILER STATS.

	.JBREN==124		; THESE ASSIGNMENTS WILL GIVE
	.JBOPS==135		; LOADING ERRORS IF JOBDAT CHANGES
	.JBVER==137
	.JBHDA=10
SUBTTL PATCH MACRO FOR DEVELOPMENT CHANGES

	DEFINE	PATCH (A),<
	IFG	<10-A>,<
	PAT00'A=.
	>
	IFG	<100-A>,<
	IFLE	<10-A>,<
	PAT0'A=.
	>>
	IFLE	<100-A>,<
	PAT'A=.
	>
	>



SUBTTL EDIT MACRO FOR BUG-FIXES

	DEFINE	EDIT (A),<
	IFG	<10-A>,<
	EDT00'A=.
	>
	IFG	<100-A>,<
	IFLE	<10-A>,<
	EDT0'A=.
	>>
	IFLE	<100-A>,<
	EDT'A=.
	%E.'A=:0
	>
	>
SUBTTL ALGOL UUOS, OPDEFS AND MAGIC NUMBERS

; ALGOL UUOS:

	OPDEF	PJRST	[JRST]	; PUSHJ POPJ COMBINATION

	OPDEF	DUMPR [001B8]	; DUMP UUO
	OPDEF	SYSER1 [002B8]	; SYSTEM ERROR UUO #1
	OPDEF	SYSER2 [003B8]	; SYSTEM ERROR UUO #2
	OPDEF	IOERR [004B8]	; INPUT/OUTPUT ERROR UUO
	OPDEF	LIBERR [005B8]	; LIBRARY ERROR UUO
	OPDEF	CCORE [006B8]	; CHANGE CORE UUO
	OPDEF	CCORE1 [007B8]	; SHIFT THE STACK
	OPDEF	BREAK [010B8]	; BREAKPOINT.
	OPDEF	DDTERR [011B8]	; ALGDDT ERROR.

; ALGOL OPDEFS:

	OPDEF	JFOVO [JFCL	11,]
				; SPECIAL UNDERFLOW TREATMENT

	OPDEF	XCTA [XCT	1,]
				; LEFT HAND SIDE REFERENCE

	$A==000040		; FLAG FOR DETECTING XCTA



IFE PROC-KA10,<
	DEFINE LRLOAD(A,B)
<	MOVE	A,B
	MOVE	1+A,1+B
>
	DEFINE LRSTOR(A,B)
<	MOVEM	A,B
	MOVEM	1+A,1+B
>
	DEFINE LRNEG(A,B)
<	DFN	A,B
>>

IFE PROC-KI10,<
	DEFINE LRLOAD(A,B)
<	DMOVE	A,B
>
	DEFINE LRSTOR(A,B)
<	DMOVEM	A,B
>
	DEFINE LRNEG(A,B)
<	DMOVN	A,A
	IFN <<A+1>&17-<B>>,<PRINX DFN ERROR>
>>


; DEFAULT (& MINIMUM) HEAP SIZE

	DELTA1==^D521


; KEN'S 'RANDOM' NUMBER:

	RANDOM==647327
SUBTTL ACCUMULATOR ASSIGNMENTS

	A0==0			; MUST BE 0 FOR SBYTE!
	A1==1
	A2==2
	A3==3
	A4==4
	A5==5
	A6==6
	A7==7
	A10==10
	A11==11
	A12==12
	A13==13
	DB==14			; DATA BASE
	DL==15			; DYNAMIC LEVEL
	AX==16			; AUXILIARY ADDRESS
	SP==17			; DYNAMIC STACK POINTER


SUBTTL PROCEDURE CALL PARAMETER CODES

; PARAMETER CODES (FORMAL AND ACTUAL PARAMETER DESCRIPTORS):

; BIT 0: STATIC/DYNAMIC

	$D==400000		; DYNAMIC

; BITS 1-2: KIND:

	$KIND==300000

	$VAR==000000		; VARIABLE
	$EXP==100000		; EXPRESSION
	$ARR==200000		; ARRAY
	$PRO==300000		; PROCEDURE

; BITS 3-8: TYPE:

	$TYPE==077000

	$I==007000		; INTEGER
	$R==016000		; REAL
	$LR==025000		; LONG REAL
	$C==031000		; COMPLEX
	$LC==032000		; LONG COMPLEX
	$B==043000		; BOOLEAN
	$S==070000		; STRING
	$L==052000		; LABEL
	$N==062000		; NON-TYPE

; BITS 9-11: STATUS:

	$STAT==000700
	$STATUS==$STAT

	$SIM==000000		; SIMPLE
	$REG==000100		; REGULAR
	$OWN==000200		; OWN
	$EXT==000300		; EXTERNAL
	$FOW==000400		; FORWARD
	$FON==000500		; FORMAL-BY-NAME
	$FOV==000600		; FORMAL-BY-VALUE
	$STMT==000700		; STATEMENT

; BITS 12 - 17: P ADDRESS (ACTUALS)

	$P==000077
	$DEC==000040		; DECLARED

; BITS 18 - 35: Q ADDRESS (ACTUALS)

; BITS 18 - 35: FORMAL PARAMETER ADDRESS (FORMALS)
; "WILD CARD" TYPES:

	$WV==000000		; WILD VARIABLE
	$AB==001000		; ARITHMETIC/BOOLEAN
	$ABN==002000		; ARITHMETIC/BOOLEAN/NON-TYPE
	$IB==003000		; INTEGER/BOOLEAN
	$WF==004000		; WILD FLOATING (REAL, LONG REAL)
	$WA==040000		; WILD ARITHMETIC (INTEGER, REAL, LONG REAL)

; COMPOUND TYPE BITS:

	$ARC==040000		; NOT ARITHMETIC
	$IRLR==004000		; INTEGER, REAL OR LONG REAL
	$IR==060000		; NOT (INTEGER OR REAL)
	$CLC==044000		; NOT (COMPLEX OR LONG COMPLEX)
	$VAR1==020000		; NOT VARIABLE OF ONE WORD
	$VAR2==002000		; NOT VARIABLE OF TWO WORDS
	$VAL==000200		; VALUE

; PROCEDURE INFORMATION (RELATIVE TO DL):

	LINKDL==-7		; DL CHAIN
	LINKPC==-6		; CONTEXT PC
	PRGLNK==-5		; PROGRAM LINK
	PMBPTR==-4		; POST-MORTEM BLOCK POINTER
	CONDL==-3		; CONTEXT DL
	BLKPTR==-2		; BLOCK POINTER
	PLBLKL==-1		; PROCEDURE LEVEL, BLOCK LEVEL

	PRMMAX==12		; MAXIMUM NUMBER OF PARAMETERS
				; IN MIN, MAX ETC.



	; BITS IN DB LEFT HALF

	OMC1==400000		; 0 - RUNNING ON KA10
				; 1 - RUNNING ON KI10/KL10 (D.P. FLOATING PT)
	OMC2==200000		; 0 - RUNNING ON KA10/KI10
				; 1 - RUNNING ON KL10
	SMC1==100000		; 0 - COMPILED ON KA10
				; 1 - COMPILED ON KI10/KL10
	SMC2==40000		; 0 - COMPILED ON KA10/KI10
				; 1 - COMPILED ON KL10
	TMC1==20000		; 0 - COMPILED FOR KA10
				; 1 - COMPILED FOR KI10/KL10
	TMC2==10000		; 0 - COMPILED FOR KA10/KI10
				; 1 - COMPILED FOR KL10
	TRLVEL==4000		; 0 - NO TRACE STATEMENTS
				; 1 - PROGRAM CONTAINS TRACE STATEMENTS
	INDDT==2000		; 1 - IN DEBUGGING SYSTEM
	STMTST==1000		; 1 - USER HAS INTERRUPTED (^C)
	TMPFL1==400	; TEMPORARY FLAGS - USED ONLY IN GETOWN
	TMPFL2==200	; USED ONLY IN GETOWN
	TMPFL3==100	; USED ONLY IN FUNCT., AND IN ERRM30/DEBUGGER INTERFACE.

	; BITS 13-17 ARE RESERVED !!!


	OMC==OMC1
	SMC==SMC1
	TMC==TMC1

SUBTTL MAIN ASSIGNMENTS

; DUMP ROUTINE NOT LOADED: DUMP=0
; DUMP ROUTINE LOADED: DUMP=1

	IFNDEF DUMP, <
	DUMP=0>			; DEFAULT: DUMP ROUTINE NOT LOADED
SUBTTL DATA BASE STRUCTURE

	%DBL==0
DEFINE %DBMAC(NAME,L<1>) <
	NAME==%DBL
	%DBL==%DBL+L
>

; ADDRESSES ARE RELATIVE TO THE DATA BASE (DB)

	%DBMAC(%UUO,2)		; UUO ENTRY
	%DBMAC(%CONC,4)		; CONTROL-C TRAP
	%DBMAC(%CHAN)		; CURRENTLY SELECTED I/O CHANNELS
	%DBMAC(%TTYCH)		; CURRENT CH #'S OPEN FOR TTY
	%DBMAC(%RAND)		; RANDOM NUMBER
	%DBMAC(%ESP)		; EMERGENCY STACK POINTER
	%DBMAC(%ACCS,20)	; DUMP FOR USER ACCUMULATORS
	%DBMAC(%SYS0)		; PARAMETER BLOCK ADDRESS
	%DBMAC(%SYS1)		; INITIAL CORE SIZE
	%DBMAC(%SYS2)		; INACTIVE HEAP CHAIN
	%DBMAC(%SYS3)		; DATE OF STARTING PROGRAM
	%DBMAC(%SYS4)		; TIME OF DAY AT START OF PROGRAM
	%DBMAC(%SYS5)		; RUN TIME AT START OF PROGRAM
	%DBMAC(%SYS6)		; DUMP COUNT
	%DBMAC(%SYS7)		; GENERAL ACCUMULATOR SAVE
	%DBMAC(%SYS10)		; GENERAL ACCUMULATOR SAVE
	%DBMAC(%SYS11)		; GENERAL ACCUMULATOR SAVE
	%DBMAC(%SYS12)		; GENERAL ACCUMULATOR SAVE
	%DBMAC(%SYS13)		; GENERAL ACCUMULATOR SAVE
	%DBMAC(%SYS14)		; USED IN APR ERROR HANDLER
	%DBMAC(%SYS15)		; USED IN APR ERROR HANDLER
	%DBMAC(%SYS16)		; USED IN APR ERROR HANDLER
	%DBMAC(%SYS17)		; USED IN APR ERROR HANDLER
	%DBMAC(%SYS20)		; COUNT OF STACK-SHIFTS
	%DBMAC(%SYS21)		; SAVE INITIAL HEAP ORIGIN
	%DBMAC(%SYS22)		; POINTER TO TRACE VECTOR
	%DBMAC(%SYS23)		; COMPILER VERSION WORD
	%DBMAC(%SYS24)		; MAX # USED WORDS IN HEAP-TABLE
	%DBMAC(%IFDAT,3)	; FOR OVERLAY LOADER
	%DBMAC(%SYSOV)		; FUNCT. PRIVATE HEAP-CHAIN BASE
	%DBMAC(%%TTY)		; I/O DIRECTORY WORD FOR TTY (-1)
	%DBMAC(%IODR,40)	; I/O DIRECTORY
	%DBMAC(%TRAPS,100)	; TRAP VECTOR
	%DBMAC(%TRPTR)		; POINTER TO CURRENT TRACE ENTRY
	%DBMAC(%TRLNTH)		; LENGTH OF TRACE TABLE
	%DBMAC(%TRLV)		; DYNAMIC BLOCK POINTER
	%DBMAC(%TTY,6)		; CHANNEL -1 TTY (%TTCALL)
	%DBMAC(%IBUFF,21)	; CHANNEL -1 INPUT BUFFER
	%DBMAC(%OBUFF,21)	; CHANNEL -1 OUTPUT BUFFER
	%DBMAC(%ES,22)		; EMERGENCY STACK
	%DBMAC(%SFILE,12)	; SYMBOL FILE-NAME ETC.
	%DBMAC(%DDTST)		; AOBJN POINTER TO SYMBOL TABLE
	%DBMAC(%DDTBK)		; AOBJN POINTER TO BREAKPOINT TABLE
	%DBMAC(%DDTAL)		; XWD ADDR OF CURRENT BREAKPOINT CONTROL BLOCK OR 0,
				;   PTR TO AUTOLIST TABLE OR 0 (FIXED 26. WORDS LONG)
	%DBMAC(%DDTBI)		; AOBJN POINTER TO BLOCK INDEX
	%DBMAC(%DDTBE)		; POINTER TO CURRENT BLKIDX ENTRY
	%DBMAC(%DDTTY)		; SAVE OLD %CHAN DURING DDT.
	%DBMAC(%DDTPT)		; XWD ADDR OF FAILING MODULE'S LOADER S.T. ENTRY,
				;  ADDR OF STN-ITEM OF ERROR OR PAUSE.
	%DBMAC(%DDTIP)		; I/P POINTER, OR POINTER TO IT IF DDALST IS SET.
	%DBMAC(%DDTER)		; L.H. = REDIRECT CHANNEL #,
				; R.H. = ADDR OF LAST ERR MSG (FOR EXPERT/NOVICE)
	%DBMAC(%DDTFL)		; SAVE FOR FLAG REGISTER.
	%DBMAC(%DDTPC)		; XWD DL OF CONTEXT ESTABLISHED BY FNDADR,
				;   ADDR OF ERROR OR PAUSE. SAVED BY ERRMON OR PAUSE CODE.
	%DBMAC(%DDTUW)		; FOR UNWIND COMMAND. XWD ADDR OF
				; ORIGINAL ("PROPER") CONTEXT, HIGHEST (I.E.
				; ("PROPER") DYNAMIC PROCEDURE LEVEL.
	%DBMAC(%DDTPL)		; DYNAMIC PROCEDURE LEVEL
	%DBMAC(%DDTDL)		; TRUE TOP-LEVEL DL (IN CASE OF THUNKS)
EDIT(043); ADD SOME LOCATIONS FOR CUSTOMERS
	%DBMAC(%CUST1)		; [E043] TWO LOCATIONS FOR CUSTOMERS TO USE
	%DBMAC(%CUST2)		; [E043] ..
	%DBMAC(%DDTGO)		; ADDRESS OF "GOTO" BLOCK
	%DBMAC(%DDTCB,33)	; ALGDDT COMMAND BUFFER
	%DBMAC(%DDTFB,33)	; WHOLE-FIELD BUFFER
	%DBMAC(%DDTIB,16)	; IDENTIFIER BUFFER
	%DBMAC(%DDTNL)		; 'NEXT' DL,,'NEXT' B.P. ADDRESS
	%DBMAC(%DDTCC)		; CONTROL-C STATUS WORD
	%DBMAC(%UWCON)		; CONTEXT FOR UNWIND
	%DBMAC(%UWTOP)		; MAXIMUM ALLOWED UNWIND
	%DBMAC(%DDUWB)		; [E127] LH - CURRENT UNWOUND BLOCK LEVEL
				; [E127] RH - MAX. BLOCK LVL AT THIS PROC LVL
	%DBMAC(%DDERD)		; [E1000] ERROR DETECTED FLAG


	%DBL==%DBL		; LENGTH OF DATA-BASE
SUBTTL ENTRY FLAGS

; SET UP IN THE LH OF AX BY ALGOBJ IN ALGLIB:

	REEN=400000		; REENTER


SUBTTL IO CONTROL BITS

; STATUS BITS (IN LH OF IO DIRECTORY ENTRY)

	PLDEV=400000		; PHYSICAL/LOGICAL DEVICE (MUST BE BIT 0)
	DIRDEV=200000		; DIRECTORY DEVICE
	TTYDEV=100000		; TTY TYPE DEVICE
	ABMODE=040000		; ASCII/BINARY MODE
	SPOPRN=020000		; SPECIAL OPERATIONS PERMITTED
	PLTDEV=010000		; PLOTTER
	TTYTTC=004000		; TTY ON TTCALL
	SPLDEV=002000		; SPOOLED DEVICE

	INDEV=001000		; DEVICE CAN DO INPUT
	ININT=000400		; DEVICE INITED FOR INPUT
	INFIL=000200		; FILE OPEN FOR INPUT
	INEOF=000100		; INPUT EOF STATUS
	INOK=000040		; INPUT OK STATUS

	OUTDEV=000020		; DEVICE CAN DO OUTPUT
	OUTINT=000010		; DEVICE INITED FOR OUTPUT
	OUTFIL=000004		; FILE OPEN FOR OUTPUT
	OUTEOF=000002		; OUTPUT EOF STATUS
	OUTOK=000001		; OUTPUT OK STATUS

; MISCELLANEOUS SPECIAL BYTE VALUES:

	LF=012			; LINE FEED
	FF=014			; FORM FEED
	CR=015			; CARRIAGE RETURN
	CONZ=032		; CONTROL-Z
SUBTTL STRING ACCESS FLAGS

	STR1=0			; FIRST WORD
	STR2=1			; SECOND WORD

; FLAGS (USED IN LH OF SECOND WORD):

	STRDYN=200000		; DYNAMIC
	STRPRC=100000		; RESULT OF STRING PROCEDURE
	STRSPB=070000		; SPARE

	STRBS=007700		; BYTE SIZE
	STRBSC=770077		; STRBS COMPLEMENT
	STRBC=000077		; BYTE COUNT (CONTINUED IN RH)
	STRBCC=777700		; STRBC COMPLEMENT

;Flags for controlling Object Code dump formats (in L.H. of AC)

	ZERFLG==400000
	OBJOCT==200000
	OBJASC==100000
	OBJSIX==040000
	OBJSYM==020000
	OBJINT==010000
	OBJREA==004000
	OBJLR==0002000
	OBJERR==001000

	OBJDEF==OBJOCT!OBJSYM		;Default


; ERROR UUO FLAGS (LH OF M TABLES):

	FATAL==400000		; MUST BE BIT 0
	ERRDEV==200000		; INCLUDE DEVICE-NAME IN IOERR MSG
	ERRFIL==100000		; INCLUDE FILE.EXT IN IOERR MSG
	ERR2PT==40000		; MORE TO COME IN IOERR MSG

	TRAPNO=000077

SUBTTL APR TRAP AND PC FLAGS

; APR TRAP FLAGS

	APRO=000010		; ARITHMETIC OVERFLOW
	APRFPO=000100		; FLOATING POINT OVERFLOW
	APRNXM=010000		; NONEXISTENT MEMORY
	APRMPV=020000		; MEMORY PROTECT VIOLATION
	APRPLO=200000		; PUSHDOWN LIST OVERFLOW
	APRLOK=400000		; TRAP LOCK

	APRFLG=APRO!APRFPO!APRNXM!APRMPV!APRPLO!APRLOK

; PC FLAGS

	PCNDIV=000040		; NO DIVIDE
	PCFPU=000100		; FLOATING POINT UNDERFLOW
	PCFPO=040000		; FLOATING POINT OVERFLOW
	PCO=400000		; ARITHMETIC OVERFLOW

	PCOVL=PCNDIV!PCFPO!PCO

; CONTROL-C TRAP FLAG

	CONCF=2
	ILLUUO=100		; ILLEGAL UUO, ETC.
	DQUOTA=20		; EXCEEDING DISC QUOTA.

;PRINT FORMAT CONTROL FLAGS (LH OF A2):

	NUMRNG=400000		; NUMBER RANGE (EXPONENT SIGN - MUST BE BIT 0)
	NUMSGN=200000		; SIGN FLAG
	INTOVL=100000		; INTEGER OVERFLOW
	LNGEXP=040000		; LONG EXPONENT
	LNGMAN=020000		; LONG MANTISSA
	DIGEXH=010000		; DIGITS EXHAUSTED
	NOSIGN=004000		; PRINT - OR NOTHING (NOT SPACE FOR +)

; MAXIMUM SIGNIFICANCE:

	INTDIG=^D11
	SRDIG=^D9

SUBTTL MISC JOBDAT WORDS

	JBTPRG=3

	END