Google
 

Trailing-Edge - PDP-10 Archives - bb-4157h-bm_fortran20_v10_16mt9 - fortran-compiler/reqrel.bli
There are 12 other files named reqrel.bli in the archive. Click here to see a list.
!COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1981, 1985
!ALL RIGHTS RESERVED.
!
!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.

! Author:	*/TFV/CDM/AHM

GLOBAL BIND REQREV = #10^24 + 0^18 + #2517;	! Version Date:	1-Feb-85

%(

***** Begin Revision History *****

***** Begin Version 7 *****

1	1245	TFV	3-Aug-81	------
	Add RDATBLK for sparse data blocks.

2	1242	CKS	2-Sep-81
	Add RCHDATA for initialization of character strings

3	1466	CDM	1-Feb-82
	Add binds for values of LINK type codes for the EVALU table.

1511	CDM	18-Mar-82
	Add RWRITELINK for SAVE statement rel block.

1512	AHM	23-Mar-82
	Define RLONGSYMBOL  rel  block  type, PXxxxx  rel  file  psect
	indices and function names for ZSYMBOL routine.

1521	CDM	26-Mar-82
	Add macros and binds for arg checking

1525	AHM	1-Apr-82
	Define symbols for various new REL block types.

1526	AHM	6-Apr-82
	Define symbols for type 1010 code blocks.

1564	AHM	21-Jun-82
	Remove definition of RLIBREQ made during edit 1525 since it is
	no longer needed.

1674	CDM	11-Nov-82
	Fix  argchecking  further  so   that  constant  and   expression
	arguments get  flagged  as  no-update,  and  character  function
	return values are implicit (not checked).


***** Begin Version 10 *****

2310	CDM	20-Feb-84
	Output type 1131  rel block  for PSECT  redirection of  segments
	into psects.  The command scanner sets the names for the  psects
	and the code generator dumps the rel block.

2323	AHM	14-Mar-84
	Define R30CODE rel block type for type 1030 30 bit relocation
	rel blocks.  Also define RLNGCNTBLK to designate the lowest
	REL block type which uses a long count.

2423	AHM	18-Jul-84
	Support for DATA statements with address offsets greater than
	256K for extended addressing.  Define RULTIMATEDATA for type
	1160 Ultimate Sparse Data rel blocks.  Define a flurry of
	constituent bits and bytes prefixed with RULT along with it.

2432	AHM	23-Jul-84
	Create an alias named RULTFLAGS for the concatenation of the
	1160 flag bits RULTRPTFLAG, RULTFILLFLAG and RULTBYTEFLAG, and
	clear it near the top of FLUSHDATA.  Cures bad REL files
	caused by assuming that the garbage left on the top of the
	stack was zero.

2434	CDM	23-Jul-84
	Enhance argument  checking  to differentiate  between  character
	expressions /EXTEND and /NOEXTEND.  We do not want to pass a one
	word  LOCAL  byte  pointer  where  a  GLOBAL  is  wanted.   This
	condition could reference data in the wrong section.

2446	MEM	31-Jul-84
	Add LONGPSECTHEAD = 1050 and define psect attributes.

2453	AHM	22-Aug-84

	Narrow RULTSYMLEN from 9 to 8 bits, to reflect LINK's design.
	The left over bit is reserved to DEC, must be zero.  Rename
	RULTFLAGS to be the entire 1160 flag word.

2517	CDM	1-Feb-85
	Enhancements to argument checking, upgrading for statement
	functions to be up with external routines, and a few bug fixes in
	statement functions.  Added checks for structure in arguments;
	singleton (scalar), array, routine.  Added character length
	checking in statement functions.  Add values for structure fields
	in argument checking.

***** End V10 Development *****

***** End Revision History *****

)%

	%(***DEFINE STRUCTURES FOR A REL FILE BUFFER AND FOR REFERENCING
		A REL FILE BUFFER VIA A POINTER TO IT**)%
	STRUCTURE RELBUFF[IX,WD,POS,SIZE]=		!FOR A REL-FILE BUFFER
		(.RELBUFF+(.IX+1)+.WD)<.POS,.SIZE>;

	STRUCTURE PRELBUFF[IX,WD,POS,SIZE]=		!FOR A PTR TO A REL-FILE BUFFER
		(@.PRELBUFF+(.IX+1)+.WD)<.POS,.SIZE>;

	MACRO
		RDATCNT=0,-1,RIGHT$,	!COUNT OF DATA WDS IN RH OF 1ST WD
		RTYPE=0,-1,LEFT$,	!BLOCK TYPE IN LH OF 1ST WD
		RRELOCWD=0,0,WHOLE$,	!RELOCATION BITS IN 2ND WD
		RLDATWD=0,WHOLE$;	!DATA WORDS START WITH WD 3


	BIND RBLKSIZ=20;	!NUMBER OF WDS IN A REL FILE BLOCK

!
!DEFINE THE LOADER BLOCK TYPES AND DATA INFORMATION
!
BIND	RCODE = 1,		!CODE AND DATA BLOCK
	RSYMBOL = 2,		!SYMBOL BLOCK
		RGLOBDEF = 4^30,	!GLOBAL DEF IN RSYMBOL
		RGLOBDDTSUP=#44^30,	!GLOBAL DEF WITH DDT USE SUPPRESSED
		RLOCDEF = #10^30,	!LOCAL DEF IN RSYMBOL
		RLOCDDTSUP=#50^30,	!LOCAL DEF WITH DDT USE SUPPRESSED
		RLOCREQ = #10^30,	!LOCAL REQUEST IN RSYMBOL
		RLOCFIX = #50^30,	!LOCAL FIXUP FOR COMMON BLOCK VARIABLE
		RGLOBREQ = #60^30,	!GLOBAL REQUEST
		RGLOB0 = 0,	!CHAINED GLOBAL REQUEST
		RGLOB4 = #400000,	!ADDITIVE GLOBAL IN RSYMBOL
	RHISEG = 3,		!HISEG BLOCK
	RENTRY = 4,		!ENTRY BLOCK
	REND =   5,		!END BLOCK
	RNAME  = 6,		!NAME BLOCK
	RSTART = 7,		!START ADDRESS BLOCK
	RLOCAL = #10,		!LOCAL BLOCK
	RPOLISH = #11,		!POLISH FIXUP BLOCK
%1525%	RCOMMON = #20,		! Common block size
%1245%	RDATBLK = #21,		! Sparse data block
%1525%	RPSECTORG = #22,	! PSECT origin block (sets default psect index)
%1525%	RPSECTEND = #23,	! PSECT END block
%2323%	RLNGCNTBLK = #1000,	! REL blocks 1000 on up have long counts
%1242%	RCHDATA = #1004,	! Character data block
%1526%	RRIGHTCODE = #1010,	! Right relocation by psects
%1511%	RWRITELINK = #1045,	! For SAVE statement processing
%2446%	RLONGPSECTHEAD = #1050,	! PSECT header block (/EXTEND only)
%1525%		RPSSINGLE = #100000000,	! PSECT fits in a single section
%1525%		RPSNONZERO = #40000000,	! PSECT should be loaded into
%1525%					! a non-zero section
%1525%		RPSCONCAT = #10000000,	! Data in this PSECT should be appended
%1525%					!  to what was loaded before
%1525%		RPSRONLY = #2000000,	! Write protected page
%1525%		RPSWRITE = #1000000,	! Readable page
%1512%	RLONGSYMBOL = #1070,	! Long symbol names
%1512%		RLSSUPPRESS = #10,	! Suppress symbol typeout to DDT
%1512%		RLSLOCAL = #100,	! Local symbol definition
%1512%		RLSGLOBAL = #200,	! Global symbol definition or fixup
%1512%		RLSCHAIN = #40,		! Chained fixup request
%1512%		RLSADDITIVE = #50,	! Additive fixup request
%1512%		RLSSYMBOL = #60,	! Symbol fixup request
%1512%		RLSRHFIX = 3,		! Right hand fixup
%1512%		RLS30FIX = 6,		! 30 bit fixup
%1512%		RLSRABS = 0,		! Don't do any relocation
%1512%		RLSRRH = 1,		! Relocate the right half
%1512%		RLSR30 = 4,		! Relocate the low order 30 bits
%1512%		SYMBOLMAX = 4 * 4,	! Maximum number of data words of 1070
%1512%					!  blocks to buffer up at one time
%2323%	R30CODE = #1030,	! 30 bit relocation by psects
%1521%	RARGDESC = #1120,	! Octal value for Argument Descriptor Blocks.
%1521%	RCOERCION = #1130,	! Octal value for Coercion Blocks.
%2310%	RREDIRECT = #1131,	! Redirection blocks.
%2423%	RULTIMATEDATA = #1160;	! Ultimate sparse data

MACRO					! Define fields for 1160 block
%2453%	RULTFLAGS = 0,0,WHOLE $,	! Alias for clearing the flag word
%2423%	RULTRPTFLAG = 0,0,35,1 $,	! Repeat count present
%2423%	RULTFILLFLAG = 0,0,34,1 $,	! Fill count and byte present
%2423%	RULTBYTEFLAG = 0,0,33,1 $,	! Byte count present
%2423%	RULTPOS = 0,0,27,6 $,		! Position of first byte in word
![2453]	[0,0,26,1] is reserved to DEC, must be zero
%2453%	RULTSYMLEN = 0,0,18,8 $,	! Number of words in symbol request
%2423%	RULTPSECT = 0,0,RIGHT $,	! Psect index for relocating 
%2423%	RULTSYMNAM = 0,1,WHOLE $,	! First (and only) word of symbol

	! All the rest of the fields are at variable offsets from the
	! start of the block.  These macros expect the word offset
	! from the start of the REL block (the current long count) as
	! an index to access the right word.

%2423%	RULTORGADDR(LC) = (LC),-1,0,30 $,	! Origin address
%2423%	RULTSIZE(LC) = (LC),-1,30,6 $,		! Byte size
%2423%	RULTREPEATCOUNT(LC) = (LC),-1,WHOLE $,	! Repeat count word
%2423%	RULTFILLCOUNT(LC) = (LC),-1,WHOLE $,	! Fill count word
%2423%	RULTFILLBYTE(LC) = (LC),-1,WHOLE $,	! Fill byte word
%2423%	RULTBYTECOUNT(LC) = (LC),-1,WHOLE $;	! Data byte count

!DEFINE VALUES FOR RELOCATION BITS

BIND
	RELN =  0,	!NO RELOCATION BITS
	RELRI = 1,	!RELOCATE RIGHT
	RELL = 2,	!RELOCATE LEFT
	RELB = 3,	!RELOCATE BOTH HALVES

![1512] Define values for external psect indices

	PXABS=0,		! Absolute PSECT (no relocation)
	PXLOW=1,		! Low segment
	PXHIGH=2,		! High segment
	PXCODE=1,		! Code, arg blocks
	PXDATA=2,		! Scalars, small arrays
	PXLARGE=3,		! Large arrays

![2446] Psect attributes

	PACODE=RPSSINGLE OR RPSNONZERO OR RPSCONCAT OR RPSRONLY,
	PADATA=RPSSINGLE OR RPSNONZERO OR RPSCONCAT OR RPSWRITE,
	PALARGE=RPSNONZERO OR RPSCONCAT OR RPSWRITE,

![1512] Define function codes for ZSYMBOL

	LOCDEF = 0,		! Local symbol definition
	LOCSUPDEF = 1,		! Local symbol definition, but
				!  with DDT typeout suppression
	GLBDEF = 2,		! Global symbol definition
	GLBSUPDEF = 3,		! Global symbol definition, but
				!  with DDT typeout suppression
	GLBSYMFIX = 4,		! Add the value of a global symbol to a
				!  symbol's defined value
	GLB18CHNFIX = 5,	! Replace the RH of a location with the
				!  value of a global symbol
	GLB18ADDFIX = 6,	! Add the value of a global symbol to
				!  the RH of a location
	GLB30CHNFIX = 7,	! Replace the low order 30 bits of a location
				!  with the value of a global symbol
	GLB30ADDFIX = 8;	! Add the value of a global symbol to
				!  the low order 30 bits of a location

!DEFINE MACRO TO OUTPUT A CR-LF ON THE LISTING

MACRO CRLF=(CHR_#15; LSTOUT(); CHR_#12; LSTOUT();)$;


%1466%	! Binds for use in the EVALU table for converting internal compiler
%1466%	! type values to LINK values.

BIND
%1466%	TYPLOGICAL=1,
%1466%	TYPINTEGER=2,
%1466%	TYPREAL=4,
%1466%	TYPOCTAL=6,
%1466%	TYPLABEL=7,
%1466%	TYPDOUBLPREC=#10,
%1466%	TYPDBLOCTAL=#12,
%1466%	TYPGFLDBLPREC=#13,
%1466%	TYPCOMPLEX=#14,
%1466%	TYPCHARACTER=#15,
%1466%	TYPHOLLERITH=#17,
%2434%	TYPEXTCHARACTER=#21;	! Character compiled /EXTEND

%1521%	STRUCTURE RELBUFFER[WORD,POS,SIZE]=	! Structure for buffers
%1521%		(.RELBUFFER+.WORD)<.POS,.SIZE>;

MACRO	! [1521] Macros for accessing argument checking descriptor blocks
	! using structure RELBUFFER.

%1521%	! Categories for rel block
	TPRELTYPE=0,LEFT$,	! Type of rel block.
	TPRELSIZE=0,RIGHT$,	! Size of rel block.
	TPNBITRELOC=1,FULL$,	! N-Bit relocation information.
	TPARBLADD=2,FULL$,	! Argument block address.
	TPASOCCALL=3,FULL$,	! Associated call address.
	TPLDADD=4,FULL$,	! Loading address.
	TPNAMSIZE=5,FULL$,	! Size of subprog name in bytes.
	TPNAME0=6,FULL$,	! 1st word of ASCIZ name.
	TPNAME1=7,FULL$,	! 2nd word of ASCIZ name.
	TPARGCOUNT=RIGHT$,	! Where to put argument count

%1521%	! Flag bits for rel block
	TPCNT=35,1$,	! number of arguments action
	TPWHO=34,1$,	! Main vs subprogram
	TPLOD=33,1$,	! Load descriptor block at loading addr
	TPVAL=32,1$,	! Function, returns value
%1674%	TPSFERR=31,1$,	! Subroutine/Function agreement ERRor action

%1521%	! Fields in argument descriptors
	TPCNV=35,1$,	! Reserved
	TPNUP=34,1$,	! No update (literal, constant or expression)
	TPPAS=31,3$,	! Passing mechanism
	TPCTC=30,1$,	! Compile time constant
	TPTYP=24,6$,	! Argument type code (EVALU)
	TPSTR=18,6$,	! Structure type code
%1674%	TPIMPL=17,1$,	! Implicit argument flag
%1674%	TPSND=0,9$,	! Number of secondary descriptors

%1521%	! Fields in secondary descriptors
	TPMCH=33,3$,	! Action for lengths in char 2nd-ary descriptors
	TPSIZ=0,33$;	! Size of character variable in words


BIND
	! Misc.

	TPFLEA=5,	! "Formal =< actual" for secondary descriptor lengths
	TPMIN=6,	! Magic number for min num of words needed for arg ch.

	! Values for TPSTR field

%2517%	TPNOTSPECIFIED = 0,	! No value given (previous version of Fortran)
%2517%	TPSINGLETON = 1,	! Single entity, expression, array element
%2517%	TPARRAY = 2,		! Bare array name
%2517%	TPROUTINE = 5;		! External/intrinsic routine name.

	! Coercion block fields
MACRO
	CBTYPE=0,LEFT$,		! Type of coercion block
	CBCOUNT=0,RIGHT$, 	! Count of number of words in coercion blocks
	CBNBIT=1,FULL$;		! N-bit byte Relocation Information

	! What to complain about

BIND
%1674%	CBNOUPDATE = 0,
	CBPAS=1,	! TPPAS, Passing mechanism of variable
	CBTYP=2,	! TPTYP, type of variable being passed
%1566%	CBCONST=3,	! For constants
%1674%	CBNUMARG = 4,	! Number of arguments
%1674%	CBRETVAL = 5,	! Existance of return value
%1674%	CBARGLEN = 6,	! Argument length mismatch
%2517%	CBSTRUCTURE = 7,! Structure length mismatch

	! Action codes for coercions

	CBWARNING=1,	! LINK should give a warning for this action.
	CBFIXUP=3,	! Perform Fortran fixup for Char to numeric passed.
%1566%	CBNOACTION=4,	! Don't do anything

	! Values for formals, actuals

	PASSADDR=0,	! Pass by address
	PASSDESCR=1;	! Pass by descriptor