Google
 

Trailing-Edge - PDP-10 Archives - BB-KL11M-BM_1990 - lngsrc/lnklow.mac
There are 48 other files named lnklow.mac in the archive. Click here to see a list.
UNIVERSAL	LNKLOW - LOW SEGMENT DATA MODULE FOR LINK
SUBTTL	D.M.NIXON/DMN/JLd/JBC/JNG/MCHC/DZN/PAH/PY/JBS/HD/RJF 27-DEC-89


;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1973,1986,1988.
; 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.


SEARCH		LNKPAR,OVRPAR,MACTEN,UUOSYM,SCNMAC
SALL


CUSTVR==0		;CUSTOMER VERSION
DECVER==6		;DEC VERSION
DECMVR==0		;DEC MINOR VERSION
DECEVR==2423		;DEC EDIT VERSION

	LOC	137
.JBVER::<BYTE(3)CUSTVR(9)DECVER(6)DECMVR(18)DECEVR>
	RELOC
SUBTTL	REVISION HISTORY


;START OF VERSION 1A
;44	ADD ASCIZ TEXT BLOCK
;45	REMOVE INSYMSW (HASH INITIAL SYMBOLS AT ASSEMBLY TIME)
;46	ADD KLUDGE FEATURE
;55	STORE .JBVER IN .RBVER (USE VERNUM)
;61	ADD PAGING INFO FOR FX AND GS
;65	TENEX SPEEDUP
;100	ADD NEW LABELS FOR LNKCOR
;104	ADD WORD FOR PTR TO FAIL BLOCK HEADERS
;106	ADD SOFTWARE ORIGIN OF LOW/HIGH SEGMENTS
;107	REPLACE KLUDGE WITH MIXFOR

;START OF VERSION 2
;135	ADD OVERLAY FACILITY
;137	ADD SUPPORT FOR PLOT PACKAGE
;170	CHANGE IODATA MACRO TO ALLOW DIFFERENT MODES FOR PLOT SWITCH
;176	CHANGE START BLOCK (7) TO ALLOW 2 WORDS
;207	MAKE OVERLAY OVERHEAD TABLES SMALLER

;START OF VERSION 2B
;225	ADD SUPPORT FOR PSECT (MACRO VERSION 51)
;262	Add a flag to indicate /LINK was seen
;277	Add marker for PDL to restore stack on LOOKUP error
;350	DELETE REFERENCES TO RSYM
;353	REMOVE EDIT 225
;400	Use UUOSYM definitions for SFD block offsets.
;411	Add the F.ASCK flag for LNKSCN

;START OF VERSION 2C
;457	Add LIBPRC to indicate processors seen in library.
;471	Add code for ALGOL debugging system.
;534	Add F.ASZR for list of specs this text block.
;557	Clean up the listing for release.

;START OF VERSION 3A
;560	Release on both TOPS-10 and TOPS-20 as LINK version 3A(560)
;START OF VERSION 4
;567	Delete PARVAL and PARPTR.
;600	Reserve LN.PLC locations for phased lowseg code.
;621	/SAVE and /SSAVE switches generate an EXE file.
;635	Add ARSIZE storage cell and TMAMAX word.
;650	Use VM on TOPS-10 if available.
;674	Allocate the SEGPTH block for GETSEG UUO path block.
;676	Add POPOFS word.
;706	Add RC.NTB contains permanent PSECT order for this load.
;715	Modify SYMSEG to take psect name.
;720	Allocate 3 words for doing pop loop when moving a block up in core.
;730	Add S.DEBG to save /DEBUG: file spec for /LINK.
;731	SEARCH MACTEN,UUOSYM instead of C.
;732	Add LOWLOC.
;755	Add TAB.ZE table.
;761	Add RC.SET for setting relocatable PSECT bit.
;765	Release on both TOPS-10 and TOPS-20 as LINK version 4(765)

;START OF VERSION 4A
;1101	Delete LSTLOD, add DTAFLG.
;1120	Delete CPUSN,  add OKCPUS.
;1144	Add DDTMAP to flag that DDT has been mapped in.
;1172	Add PATLOC.
;1174	Add NXTGLB, RTNPC and ERCHAN.
;1204	Add LSTRRV.
;1217	Clean up the listings for release.
;1220	Release on both TOPS-10 and TOPS-20 as version 4A(1220).

;START OF VERSION 4B
;1257	Add ROOTAB.
;1262	Add NOCMX.
;1264	Add .TEMP2
;1273	Add HP.S0, HP.S1, HP.S2 to fix problem with RC.HL(1) and RC.HL(2)
;1274	Add POLLEN to store length of Polish stack.
;1300	Add BADCORE flag for fixups.
;1301	Add TABCHR flag for error routines.
;1304	Add RC.MAP and SLOT2 for handling psects with twoseg.
;1306	Add MODTYP flag whether current module is twoseg or psect.

;START OF VERSION 5
;1400	Use OVRPAR.MAC for overlay file definitions, add OW table.
;1401	Add CHAN.JF table on TOPS-20 for native file handling.
;1402	Add RFLEN on TOPS-20 for REL file handling.
;1411	Add NONZER for loading into nonzero sections.
;1423	Add globals for program data vector storage.
;1434 	Add CURTYP global.
;1442	Add EXTFLG global.

;START OF VERSION 5.1
;1704	Add WRTDAT for writable link table.
;1747	add storage for global symbols use in maintenance edits at GLBBEG
;1754	Add SAVCOD and SAVP1 for T.1072 block code.
;1764	Add word for entry vector length
;1772	make conditionals around ENTLEN TOPS20 not FTFRK2
;2002	Add PPTYPE to specify type of overlay plot.
;2046	Add DYGCNT to count typechecking blocks returned for GC.
;2053	Add ARGOVL and ARGFXP for argument checking across overlays.
;2063	Increase the value of .TLEN so that pathblock will fit in .TEMP.

;Start of Version 6
;2200	Make FXSPTR a static array, add FXSBIT for the bits.
;2202	Remove NONZER and FTFRK2.
;2210	Allocate block to hold long symbol names
;2211	Add flag word for /NOJOBDAT switch processor
;2220	Add flags for long symbol support.
;2223	Add REDLO and REDHI to store psect names for /REDIRECT.
;2227	Add CPSECT to store base of list for /PSCOMMON.
;2237	Add PDMPLN for PDV memory map.
;2245	Add four words for PDV symbol table vector information.
;2247	Remove LOWLOC on TOPS-20, remove EXTFLG.
;2250	Another word for symbol table vector length calculation
;2254	Remove FBHPTR, add SEGPTR.
;2255	Remove LSTSYM, replace it with LSTGBL and LSTLCL.
;2257	Add buffer for ERSTR% string storage during JSYS errors.
;2270	Implement pagable TP area for typechecking blocks.
;2277	Add flag word for merging DDT.
;2300	Remove F40 and FTFORK code.
;2301	Add FILBLK to store filespec for typeout.
;2304	Remove 6 temp words defined by 2237, 2245, and 2250.
;2305	Add VALBLK to hold long symbol used as value.
;2306	Add DATIME, TOPS-20 style date/time, and NOPDMP for no PDV map.
;2306	Add NAMBLK to store a long title.
;2330	Put TOPS-20 locations under a TOPS-20 conditional.
;2356	Remove unnecessary TOPS20 conditional.
;2366	Add LC paging areas, TOPS-20 conditionals.
;2374	Add TPPTR pointer to TP window.
;2403	New corporate Copywrite statement.
;2404	Add new block for Load name.
;2417	Update Copywrite statement to 1988.
;2423	Add RFSBLK to hold the returned filespec from FILOP. ".FOFIL".
SUBTTL	STORAGE

%LOW::!
OFFSET::BLOCK	1		;STARTING ADDRESS OFFSET
TIMEON::BLOCK	1		;INITIAL TIME FOR LOG FILE
IFN TOPS20,<			;[2306]
DATIME::BLOCK	1		;[2306] ACTUAL (TOPS-20) DATE AND TIME
>;[2306] IFN TOPS20
ZCOR::!				;START OF AREA TO ZERO ON INITIAL LOAD
UUOTRAP::BLOCK	2		;UUO TRAP HANDLER
ENTDDT:BLOCK	1		;DEBUG ENTRY POINT TO DDT
;TEMPORARY STORAGE SPACE - CAN BE USED ONLY BY INDEPENDENT MODULES
.TLEN==:100			;[2063] NUMBER OF WORDS
.TEMP::	BLOCK	.TLEN
.TEMP2::BLOCK	.TLEN		;[1264] SECOND TEMPORARY SPACE
GLBBEG::BLOCK	10		;[1747] STORAGE FOR GLOBAL SYMBOLS
GLBEND::			;USE IN MAINTENANCE PATCHES
EPDP::	BLOCK	LN.EPD+2	;EMERGENCY PUSH DOWN STACK
PDP::	BLOCK	1		;ORIGINAL NORMAL STACK POINTER
MARKWP::BLOCK	1		;STACK MARKER FOR LOOKUP
				; ERROR RESET IN LNKWLD
CPUHST::BLOCK	1		;HOST CPU, KA10=0, KI10=1
CPUTGT::BLOCK	1		;TARGET CPU, KA10=0, KI10=1
BATCH::	BLOCK	1		;-1 IF RUNNING UNDER BATCH
MYPPN::	BLOCK	1		;PROJECT-PROGRAMMER NUMBER OF THIS JOB
PTHARG::BLOCK	1		;ARG/FLAG FOR PATH UUO
PTHSCN::BLOCK	1		;SCAN SWITCH FOR PATH UUO
PTHDIR::BLOCK	LN.DRB		;ACTUAL PATH
PTHEND::BLOCK	1		;0 TO FORCE END
PTHLEN==.-PTHARG
RC.CUR::BLOCK	1		;CURRENT PSECT INDEX
RC.TB::	BLOCK	1		;POINTER TO RELOCATION TABLES(ORDERED BY CURRENT MODULE)
RC.NTB::BLOCK	1		;[706] POINTER TO  RELOCATION TABLES( PERMANENT ORDER FOR THIS LOAD)
RC.MAP::BLOCK	1		;[1304] POINTER PSECT NUMBERS MAP
SG.TB::	BLOCK	3		;PTR TO SEGMENT TABLES (.+1)
				;PTR TO LOW SEG DATA BLOCK
				;PTR TO HIGH SEG DATA BLOCK
SLOT2::	BLOCK	1		;[1304] PSECT WHEN SLOT 2 FOR TWOSEG
REDLO::	BLOCK	1		;[2223] PSECT TO REDIRECT LOW SEGMENT TO
REDHI::	BLOCK	1		;[2223] PSECT TO REDIRECT HIGH SEGMENT TO
RC.NO::	BLOCK	1		;NUMBER OF RELOCATION COUNTERS ASSIGNED
RC.FRE::BLOCK	1		;NUMBER FREE IN TABLES
RC.SET::BLOCK	1		;[761] 0 IF CREATED BY /SET, -1 IF NOT
RELSIZ::BLOCK	1		;BYTE SIZE FOR NEW FILE RELOCATION
ASFILE::BLOCK	1		;LOCATION OF ALGOL .SYM FILE BLOCK
ASYM::	BLOCK	1		;NUMBER OF ALGOL SYMBOLS
HIORGN::BLOCK	1		;[650] ORIGIN OF HIGH SEG
IFN FTVM,<
PAGFUN::BLOCK	1		;[650] FUNCTION FOR PAGE. UUO
PAGCNT::BLOCK	1		;[650] COUNT OF AGS FOLLOWING
PAGBLK::BLOCK	LN.PAG		;[650] ARG FOR PAGE. UUO
USEVM::	BLOCK	1		;[650] -1 IF PAGE UUO'S AVAILABLE
> ;END IFN FTVM
POPOFS::BLOCK	1		;EXP OFFSET(T4) FOR POPLP ROUTINE
PATLOC::BLOCK	1		;[1172] LOCATION OF PAT.. AREA
LSTRRV::BLOCK	1		;[1204] LAST RIGHT RELOCATABLE VALUE FROM RB.1
CRTMP1::BLOCK	1		;[2024] HOLD AC FOR FAILED PMAP RETRIES
CRTMP2::BLOCK	1		;[2024] ...
CRTMP3::BLOCK	1		;[2024] ...
ENTLEN::BLOCK	1		;[1764] LENGTH OF ENTRY VECTOR
LSTLRV::BLOCK	1		;[1466] LAST LEFT RELOCATABLE FROM RB.1
ROOTAB::BLOCK	1		;[1257] HIGHEST ABSOLUTE LOCATION IN ROOT NODE
NOCMX::	BLOCK 1			;[1262] LNKCMX already printed switch
BADCORE::BLOCK	1		;[1300] PSECT LIMIT EXCEEDED SWITCH
TABCHR::BLOCK	1		;[1301] -1 FOR TAB, 0 FOR SPACE
MODTYP::BLOCK	1		;[1306] PLUS IF TWOSEG, MINUS IF PSECT
PRGPDV::BLOCK	1		;[1423] PROGRAM DATA VECTOR STORAGE POINTER
PVPNAM::BLOCK	1		;[1423] NAME OF PSECT CONTAINING PDV
PVPSEG::BLOCK	1		;[1423] POINTER TO PSECT RELOC BLOCK
PVPLIM::BLOCK	1		;[1423] UPPER LIMIT TO WHICH PDV CAN GROW
COMPDT::BLOCK	1		;[1423] CREATION DATE OF FILE W/START ADDR
PDVADR::BLOCK	2		;[1423] ADDRESS OF PDV IN USER PROGRAM
				;[1423] 2ND WORD BEING SYMBOLIC
COERPT::BLOCK	1		;[1405] COERCION BLOCK PTR
NORBYT::BLOCK	1		;[1456] DON'T LOOK FOR ANOTHER RELOC BYTE
TPGCNT::BLOCK	1		;[2270] Count for garbage collection
TPPTR::BLOCK	1		;[2374] Pointer to the PT window
IFN TOPS20,<			;[2330]
ERRJSY::BLOCK	<ERRLEN/5>+1	;[2257] BUFFER LARGE ENOUGH FOR LONGEST ERSTR%
GETDDT::BLOCK	1		;[2277] FLAG TO MERGE DDT LATER
FILBLK::BLOCK	FILSIZ		;[2301] BLOCK OF MEMORY FOR JFNS%
>;[2330] END IFN TOPS20
IFE TOPS20,<			;[2423]
RFSBLK::BLOCK	.FOFMX+1	;[2423] RETURNED FILESPEC FROM FILOP. .FOFIL
>;[2423] END IFE TOPS20
SUBTTL	PER SEGMENT DATA


;INDEXED BY R (R=1 FOR LOW SEG, R=2 FOR HIGH SEG)

;HIGHEST DATA LOCATION IN SEGMENT
HC.S0::	BLOCK	1		;USED FOR ABS DATA
HC.S1::	BLOCK	1		;HIGHEST LOC IN LOW SEG CONTAINING DATA
HC.S2::	BLOCK	1		;DITTO FOR HIGH SEG

;HIGHEST LOCATION IN SEGMENT (MAYBE BLANK)
HL.S0::	BLOCK	1
HL.S1::	BLOCK	1		;HIGHEST LOC IN LOW SEG
HL.S2::	BLOCK	1		;...

;SOFTWARE ORIGIN OF SEGMENT (FOR CURRENT MODULE)
SO.S0==:.-1
SO.S1::	BLOCK	1		;ORIGIN OF LOW SEGMENT (USUALLY 0)
SO.S2::	BLOCK	1		;ORIGIN OF HIGH SEGMENT (USUALLY 400000)

;LOWEST LOCATION IN SEGMENT
LL.S0==:.-1
LL.S1::	BLOCK	1		;LOWEST LOC IN LOW SEG (USUALLY 0)
LL.S2::	BLOCK	1		;LOWEST LOC IN HIGH SEG (USUALLY 400000)

;[1273] HIGHEST LOCATION IN PSECT (.LOW. OR .HIGH.)
HP.S0==:.-1			;[1273] .ABS. DOES NOT HAVE PROBLEM
HP.S1::	BLOCK 1			;[1273] HIGHEST LOCATION LOADED IN .LOW.
HP.S2:: BLOCK 1			;[1273] HIGHEST LOCATION LOADED IN .HIGH.

;FIXUP INFO POINTERS FOR DATA OUT ON DSK

FX.S0==:.-1			;SO WE CAN INDEX BY 1 OR 2

;CHAINED FIXUPS - STORE VALUE IN ALL PLACES ON CHAIN

FX.S1::	BLOCK	1		;LOW SEG CHAIN
FX.S2::	BLOCK	1		;HIGH SEG CHAIN
FS.SS::	BLOCK	1		;LOCAL SYMBOL FIXUP TABLES


FXT.S0::BLOCK	1		;TEMP POINTER TO HOLD CURRENT LIST
FXC.S0==:.-1
FXC.S1::BLOCK	1		;COUNT OF TOTAL NUMBER OF SUCH FIXUPS TO DO
FXC.S2::BLOCK	1
FXC.SS::BLOCK	1		;COUNT OF SYMBOL TABLE FIXUPS PENDING

FXSPTR::BLOCK	MAXSEC		;[2200] Section fixup array
IFN TOPS20,<
FXSBIT::BLOCK	1		;[2200] Bits to indicate section exists
>;[2366] IFN TOPS20		;[2366]
SUBTTL	PAGING DATA


TAB.LW::			;LOWEST ADDRESS IN WINDOW
DEFINE XXX (ABC)<
 LW.'ABC::BLOCK 1
>
AREAS
LW.S0==:LW.LC-1			;SO WE CAN INDEX BY R (1 OR 2)
LW.S1==:LW.S0+1			;START OF LOWSEG WINDOW
LW.S2==:LW.S0+2			;DITTO FOR HIGH SEG

TAB.UW:: 			;HIGHEST ADDRESS IN WINDOW
TAB.PG::!			;BETTER NMEMONICS IF JUST TESTING FOR PAGING OR NOT
DEFINE XXX (ABC)<
 PAG.'ABC::!
 UW.'ABC::BLOCK 1
>
AREAS
UW.S0==:UW.LC-1
UW.S1==:UW.S0+1			;END OF LOW SEG WINDOW
UW.S2==:UW.S0+2			;...

PAG.S0==:UW.S0
PAG.S1==:UW.S1			;FLAG TO SHOW PAGING (IF NON-ZERO)
PAG.S2==:UW.S2

TAB.HB::			;HIGHEST BLOCK IN USE ON DSK
DEFINE XXX (ABC)<
 HB.'ABC::BLOCK 1
>
AREAS
HB.S0==:HB.LC-1
HB.S1==:HB.S0+1			;HIGHEST BLOCK ALLOCATED (ON DSK)
HB.S2==:HB.S0+2			;SAME FOR HIGH SEG PAGED CODE
SUBTTL	SYMBOL TABLE DATA


SYMLEN::BLOCK	1		;ACTUAL WORDS COUNT REQUIRED FOR THIS ENTRY
SUBLEN::BLOCK	1		;LENGTH OF SUB BLOCKS
FXSPC::	BLOCK	1		;NUMBER OF WORDS IN FIXUP TO BE GARBAGE COLLECTED
POLSTK::BLOCK	1		;START OF POLISH PUSHDOWN STACK
POLLEN::BLOCK	1		;[1274] LENGTH OF POLISH STACK

;HASH TABLE SEARCH DATA
HT.PTR::BLOCK	1		;POINTER TO HASH TABLE
HT.PRM::BLOCK	1		;CURRENT HASH PRIME NUMBER
HASHSZ::BLOCK	1		;USER DESIRED HASH TABLE SIZE
HSPACE::BLOCK	1		;SPACE LEFT IN HASH TABLE (HSFACT% FULL)
HSFACT::BLOCK	1		;PERCENTAGE OF TABLE TO FILL BEFORE REHASHING
PRMPTR::BLOCK	1		;POINTER TO NEXT PRIME NUMBER
CORFUL::BLOCK	1		;-1 WHEN CORE UUO FAILS

FILNUM::BLOCK	1		;NUMBER OF FILE ON NON-DIRECTORY DEVICE
PRGNAM::BLOCK	1		;NAME OF CURRENT PROGRAM (FROM TITLE)
NAMBLK::BLOCK	SYMSIZ		;[2326] long title
PRGBLK::BLOCK	SYMSIZ		;[2404] long core image name
LODNAM::BLOCK	1		;NAME OF THIS CORE IMAGE WHEN SAVED
JOBNUM::BLOCK	1		;SIXBIT JOB#,,OCTAL JOB#
VERNUM::BLOCK	1		;VERSION NUMBER OF CORE IMAGE
LSTGBL::BLOCK	1		;[2255] ADDRESS (REL) OF LAST GLOBAL SYMBOL
LSTLCL::BLOCK	1		;[2255] ADDRESS (REL) OF LAST LOCAL SYMBOL
				;FOR ADDITIVE GLOBAL REQUESTS
PRGPTR::BLOCK	1		;POINTER TO LIST OF BLOCK TYPE 16 REQUESTS
LIBPTR::BLOCK	1		;SAME FOR TYPE 17
USEPTR::BLOCK	1		;PTR TO LIST OF USER LIBRARIES
CTYPE::	BLOCK	1		;COMPILER TYPE PRODUCING CURRENT CODE
PROCSN::BLOCK	1		;OR OF ALL PROCESSORS SEEN
LIBPRC::BLOCK	1		;PROCESSORS SEEN THIS LIBRARY PASS
MNTYPE::BLOCK	1		;PROCESSOR FOR MAIN PROG (STARTING ADDRESS)
MNSEEN::BLOCK	1		;OR OF ALL MAIN PROGRAMS SEEN
OKCPUS::BLOCK	1		;[1120] BITS ON FOR ALL CPUS PROG WILL RUN ON
COREFL::BLOCK	1		;-1 IF LNKCOR SHUFFLED USER CORE
NAMPTR::BLOCK	1		;[2254] PTR TO CURRENT NAME IN LS AREA
SEGPTR::BLOCK	1		;[2254] PTR TO SEG RELOC INFO FOR CURRENT PROG
EXCPTR::BLOCK	1		;POINTER TO MODULES TO EXCLUDE
INCPTR::BLOCK	1		;POINTER TO MODULES TO INCLUDE
ENTPTR::BLOCK	1		;POINTER TO TEMP STORAGE OF ENTRY NAMES
NXTGLB::BLOCK	1		;[1174] PUSHJ P,LOCN FOR /ENTRY, /U, ETC.
SYMBLK::BLOCK	SYMSIZ		;[2210] LONG SYMBOL NAME
VALBLK::BLOCK	SYMSIZ		;[2305]
CPSECT::BLOCK	1		;[2227]
IFN .NWBLK,<
TTLADR::BLOCK	1		;RELATIVE ADDR OF TITLE IN DY FOR T.1003
> ;END IFN .NWBLK
IFE TOPS20,<
.PGSIZ::BLOCK	1		;CORE PAGE SIZE (1K OR 0.5K)
>
IFE FTSINGLE,<
NXTSEG::BLOCK	1		;POINTER TO GETSEG ROUTINE
LSTSEG::BLOCK	1		;DITTO
FSTSEG::BLOCK	1		;NAME OF INITIAL SEGMENT
SEGBLK::BLOCK	6		;DATA FOR GETSEG UUO
SEGPTH::BLOCK	.PTMAX		;PATH FOR GETSEG UUO
>
SUBTTL	AREA BOUNDS


;GENERATE SYMBOLS FOR AREAS
.ZZ==0	;START AT ZERO
DEFINE XXX (ABC)<
 ABC'.IX==:.ZZ
 .ZZ==.ZZ+1
>
AREAS
XXX.IX==:.ZZ-1
HG.TAB==:.ZZ-1			;HIGHEST AREA NUMBER ALLOWED
LN.TAB==:.ZZ			;LENGTH OF TABLE OF AREAS
PURGE .ZZ

TAB.LB::			;LOWER BOUND TABLE
DEFINE XXX (ABC)<
ABC'.LB::BLOCK	1>
AREAS

TAB.AB::			;ACTUAL BOUND TABLE
DEFINE XXX (ABC)<
ABC'.AB::BLOCK	1>
AREAS

TAB.UB::			;UPPER BOUND TABLE
DEFINE XXX (ABC)<
ABC'.UB::BLOCK	1>
AREAS

TAB.PT::			;POINTER TO NEXT FREE WORD TABLE
DEFINE XXX (ABC)<
ABC'.PT::BLOCK	1>
AREAS

TAB.FR::			;TABLE OF FREE SPACE IN CURRENT BLOCK
DEFINE XXX (ABC)<
ABC'.FR::BLOCK	1>
AREAS
TAB.NB::			;TABLE OF POINTERS FOR CORE ROUTINE
DEFINE XXX (ABC)<
ABC'.NB::BLOCK	1>
AREAS

TB.LNK::			;TABLE OF POINTERS TO LINKED FREE SPACE
DEFINE XXX (ABC)<
ABC'.LNK::BLOCK	1>
AREAS

TB.FSP::			;TABLE OF FREE SPACE IN LINKED LISTS
DEFINE XXX (ABC)<
ABC'.FSP::BLOCK	1>
AREAS

TAB.PP::			;IF -1 PROHIBIT PAGING OF THIS AREA
DEFINE XXX (ABC)<
ABC'.PP::BLOCK	1>
AREAS

TAB.ZE::			;[755] -1 IF FREE AREA NEED TO BE ZEROED
DEFINE XXX (ABC)<
ABC'.ZE::BLOCK	1>
AREAS


;[2366] THE LC MAP CONSISTS OF 1024 HALFWORD ENTRIES, EACH OF WHICH
;[2366] CONTAINS THE STARTING BLOCK OF A 64 DISK PAGE AREA IN THE
;[2366] LC OVERFLOW FILE.

IFE TOPS20,<			;[2366] LC MAP FOR TOPS-10
LC.UM::BLOCK	1		;[2366] HIGHEST BLOCK MAPPED
LC.UP::BLOCK	1		;[2366] HIGHEST PHYSICAL BLOCK IN FILE
LC.MAP::BLOCK	<<MAXSEC*PAGSEC*.IPS>/<.DBS*.LMS>>/2 ;[2366] THE MAP ITSELF
>;[2366] IFE TOPS20
SUBTTL	I/O DATA AREAS


H.ZER::!			;START OF AREA FOR INPUT PARAMETERS

OPENBL::BLOCK	LN.OPN		;OPEN BLOCK
FSTR==:OPENBL+I.DEV		;CURRENT FILE STRUCTURE NAME
OPNSZ==:OPENBL+I.DVZ		;STORE DEVSIZ INFO
OPNFF==:OPENBL+I.RNG		;ADDRESS OF BUFFER AREA
MDSCN==:OPENBL+I.SCN		;SPECIAL MOD WORD COPIED FROM SCAN

LBLOCK::BLOCK	LN.RIB		;ADDRESS OF LOOKUP BLOCK
RIBLEN==OPENBL+I.RIB		;EXTENDED LOOKUP BLOCK LENGTH
UFDPPN==:OPENBL+I.PPN		;PROJECT-PROGRAMMER NUMBER
FNAM==:OPENBL+I.NAM		;CURRENT FILE NAME
FEXT==:OPENBL+I.EXT		;CURRENT FILE EXTENSION
FCRE==:OPENBL+I.PRV		;CURRENT FILE CREATION WORD
FLEN==:OPENBL+I.SIZ		;CURRENT FILE LENGTH WORD
FVER==:OPENBL+I.VER		;CURRENT FILE VERSION WORD
FEST==:OPENBL+I.EST		;ESTIMATED LENGTH
FALC==:OPENBL+I.ALC		;ALLOCATED LENGTH
FDEV==:OPENBL+I.LDV		;LOGICAL DEVICE

;BLOCK TO HOLD PATH IF FULL PATH SPECIFIED
SFDARG::BLOCK	LN.SFD
SFDSCN==:SFDARG+.PTSWT
SFDDIR==:SFDARG+.PTPPN
SFDEND==:SFDARG+.PTMAX-1
H.EZER==:.-1
;I/O BUFFER HEADERS

DEFINE XXX (CH,NUM,MODE)<
 IFDIF <MODE><.IODPR>,<
  CH'BUF::BLOCK	3
>>
DEFINE XXXX (CH,NUM,MODE)<
 IFDIF <MODE><.IODPR>,<
  IFGE MODE,<
   SYN NUM'BUF,CH'BUF
>>>
IODATA
XBUF::	BLOCK	3		;FAKE BUFFER HEADER FOR INDEX LIBRARIES

DEFINE XXX (CH,NUM,MODE)<
 BLOCK 1
>
DEFINE XXXX (CH,NUM,MODE)<
 BLOCK 1
>
IO.PTR::IODATA			;1 WORD PER CHANNEL IN USE

IO.EMG::BLOCK	1		;EMERGENCY DATA BLOCK POINTER
				;USED WHEN DSK OVERFLOW  OCCURS

IFN TOPS20,<

CHAN.JF::			;[1401] FOR JFNS OF TEMP OVF FILES

DEFINE XXX (CHAN,NUM,MODE)<CHAN'.JF::BLOCK 1> ;[1401]

IODATA				;[1401]

GS.JF==GC.JF
FX.JF==FC.JF
LS.JF==SC.JF			;[1401] SC CHANNEL IS FOR LOCAL SYMBOLS
AS.JF==AC.JF			;[1401] AC CHANNEL IS ALGOL SYMBOLS
TP.JF==PC.JF			;[2270] PC CHANNEL IS ARGUMENT TYPECHECKING
> ;[1401] IFN TOPS20

PURGE	XXX,XXXX
SUBTTL	FILE SPECS


F.INZR::BLOCK	1		;POINTER TO START OF FILE SPEC
F.NXZR::BLOCK	1		;POINTER TO NEXT FILE SPEC STORAGE
F.WLZR::BLOCK	1		;USED BY WILD ( (F.INZR)+2 )
F.EDIT::BLOCK	1		; RH POINTER TO REST OF LIST IF EDITING A FILE SPEC
				; LH LOCAL FLAGS AT TIME OF ERROR (RH OF FL)
F.ASCI::BLOCK	1		;POINTER TO ASCIZ TEXT BLOCK FROM REL FILE
F.ASCC::BLOCK	1		;USED TO HOLD CHAR COUNT DURING TEXT READ
F.ASCK::BLOCK	1		;POINTER TO EXTRA KOMMAND FOR SCAN
F.ASZR::BLOCK	1		;SCAN BLOCKS THIS ASCII TEXT BLOCK
S.INZR::BLOCK	1		;SAVE F.INZR OVER /LINK
S.LHFL::BLOCK	1		;SAVE LH(FL) OVER /LINK
S.DEBG::BLOCK	1		;[730] SAVE /DEBUG FILE SPEC FOR /LINK
SWFLAG::BLOCK	1		;LINK TO SWITCHES SEEN
IO.CHN::BLOCK	1		;LAST I/O CHAN SEEN (FOR DEFERED SWITCHES)
IO.CHR::BLOCK	1		;DEVCHR OF IO.CHN
OSCANF::BLOCK	1		;-1 IF .OSCAN ALREADY CALLED
NULSPC::BLOCK	1		;-1 IF NOT A INPUT SPEC (SWITCHES ONLY, OR OUTPUT)

;INPUT GLOBAL DEFAULT AREA

G.ZER::
G.DEV::	BLOCK	1
G.NAM::	BLOCK	1
G.NAMM::BLOCK	1
G.EXT::	BLOCK	1
G.PROT::BLOCK	2
G.DIR::	BLOCK	1
G.DIRM::BLOCK	2*.FXLND-1
G.BFR::	BLOCK	1
G.SNC::	BLOCK	1
G.LZER==:.-G.ZER


;OUTPUT GLOBAL DEFAULTS
O.ZER::
O.DEV::	BLOCK	1
O.NAM::	BLOCK	1
O.NAMM::BLOCK	1
O.EXT::	BLOCK	1
O.PROT::BLOCK	2
O.DIR::	BLOCK	1
O.DIRM::BLOCK	2*.FXLND-1
O.BFR::	BLOCK	1
O.SNC::	BLOCK	1
O.LZER==:.-O.ZER
;FULL WORD SWITCHES

FLAGS::	BLOCK	1		;DEFAULT GLOBAL FLAGS (LH) OF FL ,, REMEMBER LOCAL FLAGS (RH) OF FL
MAXCOR::BLOCK	2		;MAXIMUM INCORE SIZE (LOW,HIGH)
RUNCOR::BLOCK	2		;SIZE OF JOB AT RUN TIME (LOW,HIGH)
RUNAME::BLOCK	1		;NAME FOR CORE IMAGE
SSNAME::BLOCK	1		;NAME FOR SAVE COMMAND
SSEXT::	BLOCK	1		;EXTENSION FOR SAVE/SSAVE COMMAND
EXEBLK::BLOCK	1		;EXE FILE BLOCK COUNT
EXEDIR::BLOCK	2		;POINTS TO THE EXE DIRETORY PAGE IN CORE
MAPCON::BLOCK	1		;CONTENTS OF MAP (FROM SWITCH)
MAPSW::	BLOCK	1		;WHEN MAP IS TO BE OUTPUT
EXECSW::BLOCK	1		;[1144] -1,,x IF /EXECUTE, x = ADDR TO START
DEBUGSW::BLOCK	1		;[1144] -1,,INDEX IF /DEBUG, 0,,INDEX IF /TEST
DDEBUG::BLOCK	1		;DEFAULT DEBUGGING AID
GOTO::	BLOCK	1		;GO TO TERMINATION ADDRESS
FRECOR::BLOCK	1		;FREE CORE TO BE KEPT DURING LOAD
SYMFRM::BLOCK	1		;-1 IF NEW, 0 IF OLD
NOSYMS::BLOCK	1		;-1 FOR NO SYMBOL TABLE REQUIRED
NOLIBS::BLOCK	1		;-1 FOR NO DEFAULT LIBRARIES
PASDFL::BLOCK	1		;[1435] /DEBUG:PASCAL SEEN
IFE TOPS20,<			;[2247]
LOWLOC::BLOCK	1		;[732] LOWEST LOCATION
>;[2247] IFE TOPS20
SYMSEG::BLOCK	1		;SEGMENT TO SAVE SYMBOLS IN
SSGNAM::BLOCK	1		;[715] PSECT NAME TO SAVE SYMBOLS IN
SYMLMS::BLOCK	1		;[2220] -1 IF SYMLIM IS SYMBOLIC
SYMLIM::BLOCK	1		;[715] SYMBOL LIMIT(NEXT PSECT ORIGIN)
				;[727] BIT0 ON MEANS DEFAULT LIMIT--
				;[727] /SYMSEG & /UPTO MAY OVERRIDE IT.
OTSEG::	BLOCK	1		;SEGMENT TO PUT OTS IN 
SYMSRT::BLOCK	1		;HOW SYMBOL TABLE IS TO BE SORTED
MAPSRT::BLOCK	1		;HOW MAP IS TO BE SORTED
IFN TOPS20,<			;[2366]
NOJBDA::BLOCK	1		;[2211] -1 IF NO JOBDAT WANTED
>;[2366] IFN TOPS20
SCNSYM::BLOCK	1		;[2220] -1 IF PARSED A SYMBOL

;LOG AND ERROR PARAMETERS
LOGLVL::BLOCK	1		;SWITCH VALUE FOR LOG FILE MESSAGES
ERRLVL::BLOCK	1		;SAME FOR TTY ERROR MESSAGES
SEVLVL::BLOCK	1		;FATAL ERROR CUTOFF
VERLVL::BLOCK	1		;VERBOSITY LEVEL
ERRCOD::BLOCK	1		;ERROR CODE FOR LAST ERROR
LOGTTY::BLOCK	1		;-1 IF LOG DEV IS TTY (USE TTCALLS)
LOGSUB::BLOCK	1		;POINTS TO SOSG LOG OUTPUT ROUTINE IN LOW SEG
TTYSUB::BLOCK	1		;DITTO FOR TTY (BUFFER FOR OUTCHR'S)
LOWSUB::BLOCK	1		;LOG SUB ,, TTY SUB ;INCASE NEEDED LATER
TTYBUF::BLOCK	3		;FAKE BUFFER HEADER FOR OUTPUT TTY
LINBUF::BLOCK	LN.CPL/5+1	;LINE BUFFER FOR ABOVE
RTNPC::	BLOCK	1		;[1174] ADDR OF LAST JMP .ETC. FOR RTN
ERCHAN::BLOCK	1		;[1174] CHANNEL FOR FILE-RELATED ERRORS
PRTMSG::BLOCK	1		;[1174] FLAG FOR HOW MUCH OF MESSAGE TO PRINT
NEGOFF==:400
BLCOMM::BLOCK	1		;SIZE OF BLANK COMMON
LOD37::	BLOCK	1		;OVERHEAD FOR COBDDT
OWNLNG::BLOCK	1		;ALGOL OWN LENGTH
%OWN::	BLOCK	1		;ALGOL OWN AREA POINTER
;VARLNG::BLOCK	1		;LVAR VARIABLE LENGTH
LINKTB::BLOCK	1		;POINTER TO LINK TABLE (TYPE 12)
				;NOTE THIS IS INDEXED BY W2 WHEN SETUP
T11FA::	BLOCK	1		;XWD LENGHT, RELATIVE ADD OF POLISH BLOCK
T11BP::	BLOCK	1		;BYTE POINTER TO FIXUP
SVSAT::	BLOCK	1		;NUMBER OF OPERANDS NEEDED
SVSAT1::BLOCK	1		;NUMBER STILL NEEDED
DTAFLG::BLOCK	1		;[1101] INPUT DEVICE IS DECtape
IFN TOPS20,
<RFLEN::BLOCK	1		;[1402] LENGTH OF CURRENT REL FILE>
LSTBLK::BLOCK	1		;INDEX - POINTER TO LAST BLOCK LOADED
SAVCOD::BLOCK	1		;[1754] SAVE 9-BIT SYMBOL CODE, INCASE OF ERROR
SAVP1::	BLOCK	1		;[1754] SAVE P1 FOR LONG SYMBOL COMPARE
SYMFLG::BLOCK	1		;ADDITIONAL SYMBOL FLAGS TO APPLY TO FIXUP SYMBOL
CURTYP::BLOCK	1		;[1434] CURRENT REL BLOCK TYPE BEING PROCESSED

SAVEAC::BLOCK	20		;SAVE VARIOUS AC
				;SAVE ACS T1-T4 & P1 IN LNKLOG
				;SO WE CAN PASS ARGS IN ALL ACCS
				;SAVE AC0 AND P1-17 IN LNKERR
				;SO WE CAN RETURN
SUBTTL	PLOT DATA STORAGE


PLOTSW::BLOCK	1		;-1 IF PLOT WANTED
DEFINE KEYMAC (A,B)<
 IFIDN <A><PLT>,<
  IRP B,<
   B::	BLOCK	1
>>>
PLTTAB::!KEYWORDS

COMMENT	/
INCHES::BLOCK	1		;WIDTH IN INCHES
LEAVES::BLOCK	1		;NO. OF LEAVES
STEPS::	BLOCK	1		;NO. OF STEPS PER INCH.
/
PPTYPE::BLOCK	1		;[2002] PLOTTER TYPE
SUBTTL	OVERLAY DATA STORAGE


IFN FTOVERLAY,<

DI::	BLOCK	DI.LEN		;[1400] DIRECTORY FOR OVERLAY FILE
CS::	BLOCK	CS.LEN		;[1400] LINK CONTROL SECTION
ET::	BLOCK	ET.LEN		;[1400] EXTERNAL REFERENCE TABLE
;DATA REQUIRED FOR OVERLAYS
OVERLW::BLOCK	1		;TYPE OF OVERLAY
RGNNUM::BLOCK	1		;REGION NUMBER
RGNNAM::BLOCK	1		;REGION NAME
L.MAX::	BLOCK	1		;MAX LINK NO. WE CAN HANDLE IN TABLE
LNKTBL::BLOCK	1		;TABLE OF DISC ADDRESSES
OVLBLK::BLOCK	1		;HIGHEST BLOCK IN USE
BRNLEN::BLOCK	1		;AOBJN WORD FOR NO. OF LINKS IN CURRENT BRANCH
BRNTBL::BLOCK	1		;TABLE OF LINKS IN THIS BRANCH
BRNDSK::BLOCK	1		;PARALLEL TABLE OF LENGTH,,DSK ADDRESS
BG.SCH::BLOCK	1		;-1 IF ALLOWED TO SEARCH BG TABLES
EXTCNT::BLOCK	1		;COUNT OF MAX # OF EXTTABS SEEN
INTCNT::BLOCK	1		;SAME FOR INTTABS
LNKMAX::BLOCK	1		;HIGHEST LINK # SEEN
LNKNO.::BLOCK	1		;TEMP, USED TO HOLD CURRENT LINK NO.
BRNMAX::BLOCK	1		;MAX DEPTH OF BRANCH
ADDOVU::BLOCK	1		;ADDRESS OF .OVRLU ROUTINE
FSTPTR::BLOCK	1		;INITIAL PTR TO OVERLAY TREE
LSTPTR::BLOCK	1		;POINTER TO LAST LINK IN TREE
LNMPTR::BLOCK	1		;POINTER TO LIST OF LINK NAMES
RBGPTR::BLOCK	1		;RELOCATABLE BOUND GLOBAL PTR
BRNADD::BLOCK	1		;PARALLEL TABLE OF LINK#,,LOWEST ADDRESS
OVLOFF::BLOCK	1		;OFFSET IF BASE OF LINK IS NOT IN CORE
OVINEX::BLOCK	1		;PERMANENT INCLUDE/EXCLUDE  
LINKSEEN::BLOCK	1		;FLAG TO INDICATE /LINK PROCESSED:
				; -1 WHEN BEGIN PROCESSING /LINK
				;  0 WHEN BEGIN NEXT /NODE
ARSIZE::BLOCK	1		;[635] GLOBAL,,THIS LINK'S ARSIZE.
TMAMAX::BLOCK	1		;[635] BIGGEST TMA ERROR SEEN
WRTDAT::BLOCK	1		;[1704] PTR TO WRITABLE OVERLAY TABLE
ARGOVL::BLOCK	1		;[2053] -1 if typechecking BG area
ARGFXP::BLOCK	1		;[2053] PTR to list of character fixups
>;END OF IFN FTOVERLAY
IFN FTOVERLAY,<
;NOTE THAT ALL MEMORY FROM HERE TO PH.ZZ **MUST** BE CONTIGUOUS!
PH::	BLOCK	PH.LEN		;[1400] PREAMBLE FOR EACH LINK
OV.S0==:.-1
OV.S1::	BLOCK	1		;COPY OF HC.S1,,HL.S1
OV.S2::	BLOCK	1		;COPY OF HC.S2,,HL.S2
PV.S0==:.-1
PV.S1::	BLOCK	1		;COPY OF OV.S1 AT START
PV.S2::	BLOCK	1		;COPY OF OV.S2 AT START
>;END OF IFN FTOVERLAY
OV1.Z0::!			;DATA TO CLEAR ON LNKOV1
GSYM::	BLOCK	1		;COUNT OF GLOBAL SYMBOLS
USYM::	BLOCK	1		;COUNT OF UNDEFINED (REQUESTED) GLOBALS
MSYM::	BLOCK	1		;COUNT OF MULTIPLY DEFINED GLOBALS
LSYM::	BLOCK	1		;COUNT OF SYMBOL WORDS (PLUS GLOBALS)
STADDR::BLOCK	2		;STARTING ADDRESS
IFN TOPS20,<			;[2202]
THSTRT::BLOCK	2		;[1450] POSSIBLE 30-BIT STARTING ADDRESS
NOPDMP::BLOCK	1		;[2306] -1 IF NO DEFAULT PDV MAP
> ;[2202] IFN TOPS20
STANAM::BLOCK	1		;ACTUAL PROG NAME CONTAINING IT
PRGNO::	BLOCK	1		;NUMBER OF PROGRAMS LOADED
PATSPC::BLOCK	1		;SPACE TO LEAVE BETWEEN CODE AND SYMBOLS

IFN FTOVERLAY,<
BSYM::	BLOCK	1		;NO. OF SYMBOLS COPIED FROM BOUND TABLES
SPACE::	BLOCK	1		;SPACE TO ALLOCATE FOR THIS LINK
OV1.ZE==:.-1			;LAST WORD CLEARED
PH.ZZ==:.-PH			;[1400] PER-LINK MEMORY FOR LINK'S USE

LNKNAM=:CS+CS.LNM		;[1400] LOGICAL NAME OF THIS LINK
SYN	BRNMAX,BRNPTR		;USED TO BUILD PATH
>
IFE FTSINGLE,<
PHAZLO::BLOCK	LN.PLC		;[600] BLOCK FOR PHASED LOWSEG CODE
> ;END IFE FTSINGLE

S.EZER=.-1
EZCOR==:.-1			;END OF AREA TO ZERO

SYN	GS.LB,NAMLOC

	END