Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-10 - 43,50517/comuni.mac
There are 16 other files named comuni.mac in the archive. Click here to see a list.
UNIVERSAL COMUNI.MAC FOR LIBOL/COBOL VERSION 10
SUBTTL	IMPURE AREA FOR LIBOL
;*****COPYRIGHT 1975 DIGITAL EQUIPMENT CORP., MARLBORO MASS.

;V10******
;	5/15/75		/DBT	BIS ADDITIONS
;	5/29/76		/RBC	MODIFIED FOR RPGII
;************

;*****ALL RPGII MODIFICATIONS COPYRIGHT 1976 BOB CURRIER AND CERRITOS COLLEGE

	SEARCH	RPGPRM
	%%LBLP==:%%LBLP
	BIS==:BIS
	MCS==:MCS
	DBMS==:DBMS

;COMUNI.MAC EDIT NO
%%COMUNI==2

;STARTING ADDRESSES FOR LIBOL.SHR  HIGH AND LOW SEGMENTS
;THESE NUMBERS ARE REQUIRED FOR COMMUNICATION BETWEEN LIBOL AND
;COMPILER PROGRAMS

	HI.PUR==400010		;FIRST ABSOLUTE ADDRESS OF LIBOL.SHR
	LO.PUR==140		;FIRST ABSOLUTE ADDRESS OF LIBOL.LOW


;THE FOLLOWING SERIES OF MACROS DEFINES THE LOW SEGMENT
;
;	ELMT%% IS A MACRO WITH PARAMETERS  NAME,LENGTH,VALUE
;		NAME	-	LOCATION NAME 
;		LENGTH	-	LENGTH IN WORDS
;		VALUE	-	CONTENTS OF LOCATION
;
;	ALL OF THE PARAMETERS ARE OPTIONAL  THE DEFAULT OF LENGTH IS 1

;	ELMT%% IS REDEFINED ACCORDING TO WHAT ONE WISHES TO KNOW ABOUT
;	THE LOW SEGMENT.
;
;	SYMH%% AND SYML%% ARE MACROS WITH PARAMETERS NAME,VALUE
;		NAME AND VALUE ARE REQUIRED.  THE MACROS ARE REDEFINED IN
;		THE SAME FASHION AS ELMT%%
;		SYMH%%	-	HIGH SEG SYMBOL
;		SYML%%	-	LOW SEG SYMBOL

;
; THE FOLLOWING MACRO DEFINES THE LIBOL LOW SEGMENT LOCATIONS
; WHICH ARE REFERENCABLE AS EXTERNALS BY ROUTINES OUTSIDE OF THE
; LIBOL HIGH SEGMENT.  SYMBOLS TO RESOLVE THE EXTERNAL REFERENCES ARE
; GENERATED BY LILOWS.MAC VIA A REFEENCE TO LOWAD% MACRO.
; THESE ARE THE ONLY EXTERNALLY REFERENCABLE LIBOL LOW SEGMENT 
; ADDRESSES.
;
; ANY ADDITIONAL SUCH LOCATIONS MUST BE ADDED AT THE END OF THE 
; CURRENT SET.  CHANGING THE RELATIVE POSITION OR REMOVING ANY OF
;  THE EXISTING ITEMS WILL PRODUCE INCOMPATABILITIES WITH
; PREVIOUSLY COMPILED AND/OR LOADED COBOL PROGRAMS

; INITIALIZATION:
;
; THESE LOCATIONS ARE INITIALIZED BY LOADING LILOWS OR LIBREL
; OR BY COBST.


DEFINE	VISBL%<>
SUBTTL	HEADER BLOCK OF COBOL PROGRAMS


;	DEFINITION OF THE INFORMATION HEADER BLOCK GENERATED
;	AT THE BEGINNING OF EACH COBOL PROGRAM

DEFINE	INFBK% <
	ELMT%%	OTFBAS;;	OTFBAS
	ELMT%%	MEMRY.;;	MEMRY.
	ELMT%%	TOTBAS;;	TOTBAS
	ELMT%%	TABKEY;;	TABKEY
	ELMT%%	FILES.;;	FILES.
	ELMT%%	PUSHL.;;	PUSHL.
	ELMT%%	FRCFIL;;	FRCFIL
	ELMT%%	ARRBAS;;	ARRBAS
	ELMT%%	.STLST;;	STKLST
>


;	DEFINE THE VALUE OF FIXNUM AS THE LENGTH OF THIS AREA

	FIXNUM==0
	DEFINE	ELMT%%	(N%,L<1>,V) <
	FIXNUM==FIXNUM+1	>
	INFBK%
	PURGE	ELMT%%

SUBTTL	PRESET SECTION OF LIBOL LOW SEGMENT

	DEFINE	PREST%	<

	SYML%%	IFRST.,.;;	LOW SEG PRESET POINTER
	SYMH%%	PFRST.,.;;	HIGH SEG PRESET  POINTER

	ELMT%%	OVFLG.,1,<Z		>;;		OVERLAY CODES
	ELMT%%	LEVEL.,1,<Z		>;;		DEPTH OF PERFORM

IFN BIS,<

	ELMT%%	E0.6,1,<XWD	EDIT,0>;;	SIXBIT E0 TABLE
	ELMT%%	,1,<0>;;		FILL CHAR
	ELMT%%	,1,<0>;;		FLOAT CHAR
	ELMT%%	,1,<"$"-40>
	ELMT%%	,1,<","-40>;;
	ELMT%%	,1,<"."-40>;;
	ELMT%%	,1,<" "-40>;;
	ELMT%%	,1,<"0"-40>;;
	ELMT%%	,1,<"+"-40>;;
	ELMT%%	,1,<"-"-40>;;
	ELMT%%	,1,<"C"-40>;;
	ELMT%%	,1,<"R"-40>;;
	ELMT%%	,1,<"D"-40>;;
	ELMT%%	,1,<"B"-40>;;

	ELMT%%	E0.7,1,<XWD	EDIT,0>;;	ASCII E0 TABLE
	ELMT%%	,1,<0>;;		FILL CHAR
	ELMT%%	,1,<0>;;		FLOAT CHAR
	ELMT%%	,1,<"$">
	ELMT%%	,1,<",">;;
	ELMT%%	,1,<".">;;
	ELMT%%	,1,<" ">;;
	ELMT%%	,1,<"0">;;
	ELMT%%	,1,<"+">;;
	ELMT%%	,1,<"-">;;
	ELMT%%	,1,<"C">;;
	ELMT%%	,1,<"R">;;
	ELMT%%	,1,<"D">;;
	ELMT%%	,1,<"B">;;

	ELMT%%	E0.9,1,<XWD	EDIT,0>;;	EBCDIC E0 TABLE
	ELMT%%	,1,<0>;;		FILL CHAR
	ELMT%%	,1,<0>;;		FLOAT CHAR
	ELMT%%	,1,<133>;;
	ELMT%%	,1,<153>;;
	ELMT%%	,1,<113>;;
	ELMT%%	,1,<100>;;
	ELMT%%	,1,<360>;;
	ELMT%%	,1,<116>;;
	ELMT%%	,1,<140>;;
	ELMT%%	,1,<303>;;
	ELMT%%	,1,<331>;;
	ELMT%%	,1,<304>;;
	ELMT%%	,1,<302>;;

>	;;END OF BIS PRESETS

	SYML%%	FRSTIC,.
	ELMT%%	IIN,1,<IN 0,CMDLST	>;;		INDEX FILE UUOS
	ELMT%%	IOUT,1,<OUT 0,CMDLST	>;;		
	ELMT%%	ISETI,1,<USETI 0,(AC1)	>;;		
	ELMT%%	ISETO,1,<USETO 0,(AC1)	>;;		
	ELMT%%	ICLOS,1,<CLOSE 0,0	>;;		
	ELMT%%	IRELE,1,<RELEAS 0,0	>;;		
	ELMT%%	IGETS,1,<GETSTS 0,AC2	>;;		
	ELMT%%	ISETS,1,<SETSTS 0(AC2)>;;
	ELMT%%	IWAIT,1,<CALLI 0,10	>;;		
	ELMT%%	IRNAM,1,<RENAME 0,UEBLK.	>;;		
	SYML%%	LASTIC,<.-1>

	SYML%%	UFRST.,.
	ELMT%%	MWAIT.,1,<MTAPE 0,0	>;;		WAIT
	ELMT%%	MREW.,1,<MTAPE 0,1	>;;		REWIND
	ELMT%%	MREWU.,1,<MTAPE 0,11	>;;		REWIND AND UNLOAD
	ELMT%%	MBSPR.,1,<MTAPE 0,7	>;;		BACKSPACE RECORD
	ELMT%%	MBSPF.,1,<MTAPE 0,17	>;;		BACKSPACE FILE
	ELMT%%	MADVR.,1,<MTAPE 0,6	>;;		ADVANCE RECORD
	ELMT%%	MADVF.,1,<MTAPE 0,16	>;;		ADVANCE FILE
	ELMT%%	MWEOF.,1,<MTAPE 0,3	>;;		WRITE "EOF
	ELMT%%	MTIND.,1,<MTAPE 0,101	>;;		SET INDUSTRY COMPATIBLE MODE FOR EBCDIC
;;	BLOCK	1;;		WRITE BLANK TAPE ( 3 IN.)
;;	BLOCK	1;;		ADVANCE TO LOGICAL "EOT"
	ELMT%%	SOBOT.,1,<STATO 0,4000	>;;		SKIP IF "BOT"
	ELMT%%	SZBOT.,1,<STATZ 0,4000	>;;		SKIP IF NOT "BOT"
	ELMT%%	SZEOF.,1,<STATZ 0,20000	>;;		SKIP IF NOT "EOF"
	ELMT%%	SZEOT.,1,<STATZ 0,2000	>;;		SKIP IF NOT "EOT"
	ELMT%%	UOPEN.,1,<OPEN 0,UOBLK.	>;;		BLOCK 3 (INITIALZE FOR TTY)
	ELMT%%	UENTR.,1,<ENTER 0,UEBLK.>;;		BLOCK 4
	ELMT%%	ULKUP.,1,<LOOKUP 0,ULBLK.>;;		BLOCK 4
	ELMT%%	UOBUF.,1,<OUTBUF 0,2(AC6)>;;		
	ELMT%%	UIBUF.,1,<INBUF 0,2(AC6)	>;;		
	ELMT%%	UCLOS.,1,<CLOSE 0,0	>;;		
	ELMT%%	URELE.,1,<RELEAS 0,0	>;;		
	ELMT%%	USETI.,1,<USETI 0,(AC1)	>;;		
	ELMT%%	USETO.,1,<USETO 0,(AC1)	>;;		
	ELMT%%	UOUT.,1,<OUT 0,0		>;;		
	ELMT%%	UIN.,1,<IN 0,0		>;;		
	ELMT%%	USETS.,1,<SETSTS 0,(AC2)	>;;		FROM AC2
	ELMT%%	UGETS.,1,<GETSTS 0,AC2	>;;		INTO AC2
	ELMT%%	UWAIT.,1,<CALLI	0,10	>;;		WAIT UNTIL DEVICE INACTIVE
	ELMT%%	USEEK.,1,<CALLI	0,56	>;;		SEEK UUO
	ELMT%%	URNAM.,1,<RENAME 0,UEBLK.>;;		RENAME FOR PURGE.
	SYML%%	ULAST.,<.-1>
	SYML%%	ULEN.,<UFRST.-ULAST.>;;			LENGTH OF TABLE NEGATED

	ELMT%%	CWRIT.,1,<PUSHJ 17,WRITE.##>;;		used by XFIL in RPGIO
	ELMT%%	CWSIZ.,1,<EXP 0>;;
	ELMT%%	CWRT1.,1,<JRST XFILW1##>;;
	ELMT%%	CWRT2.,1,<JRST XFILW2##>;;
	ELMT%%	OPNCH.,1,<XWD 777774,0	>;;		OPEN OR CLOSE DEVICE CHANNEL STATUS
	ELMT%%	UOBLK.,3,<EXP 0		>;;		OPEN BLOCK
	ELMT%%	FID.PT,1,<POINT	7,FID.BK>;;
	ELMT%%	ARGBK.,6,<EXP 5		>;;		EXTENDED LOOKUP BLOCK
	SYML%%	ILAST.,<.-6>

	>
SUBTTL	NON-PRESET SECTION OF LIBOL LOW SEGMENT

;;EDIT 333	ILG	31-MAY-74


;;	DEFINE THE NON-PRESET SECTION OF THE LIBOL LOW SEGMENT

	DEFINE	LIDAT%	<

	ELMT%%	UEBLK.,4;;		ENTER BLOCK
	ELMT%%	ULBLK.,4;;		LOOKUP BLOCK
	ELMT%%	TTOBP.,1;;		TTY BYTE POINTER
	ELMT%%	TTOBC.,1;;		TTY BYTE COUNT
	ELMT%%	TTOBF.,^D27;;		TTY ASCIZ TTCALL BUFFER
	ELMT%%	STDLB.,16;;		STANDARD LABEL IN 6IXBIT

	ELMT%%	RRFLG.,1;;		SET IF RERUN CLAUSE WAS USED
	ELMT%%	REDMP.,1;;		IF NEG FORCE A DUMP
	ELMT%%	TEMP.,1;;		
	ELMT%%	TEMP.1,1;;		TEMP.1 MUST = TEMP.+1
	ELMT%%	JSARR.,1;;		.JBSA SAVED FOR RERUN;  LOCATION MUST = TEMP.+2
	ELMT%%	TEMP.2,1;;		TEMP.2
	ELMT%%	AINFO.,1;;		WORK LOCATION FOR OVERLAY
	ELMT%%	OVRBF.,3;;		BUFFER HEADER FOR OVERLAY FILE
	ELMT%%	FLDCT.,1;;		NUMBER OF THE CURRENT ACCEPT FIELD
	ELMT%%	OVRIX.,400;;		INDEX FOR OVERLAY ROUTINE
	ELMT%%	NOCR.,1;;		DURING A WTITE SKIP <CR> IF -1
	ELMT%%	PRGFLG,1;;		CLOSE FLAG - RENAME TO ZERO IF -1
	ELMT%%	TTYOPN,1;;		FILE-TABLE ADR OF OPEN TTY-FILE

	ELMT%%	ACSAV0,17;;		SAVED AC'S
	ELMT%%	MXIE,1;;		MAX INDEX ENTRY SIZE
	ELMT%%	IESAVE,1;;		INDEX ENTRY WHEN SPLITTING TOP BLOCK
	ELMT%%	MXBUF,1;;		MAX BUFFER SIZE FOR AUX BLOCK
	ELMT%%	AUXBUF,1;;		ADDRESS OF AUX BLOCK
	ELMT%%	AUXIOW,1;;		AUX BLOCK IOWD
	ELMT%%	AUXBNO,1;;		AUX BLOCK NUMBER
	ELMT%%	CMDLST,2;;		COMMAND LIST FOR IDXFILE
	ELMT%%	NEWBK1,1;;		FIRST
	ELMT%%	NEWBK2,1;;		SECOND RELATIVE DATA BLOCK NUMBER JUST ALLOCATED
	ELMT%%	OLDBK,1;;		BLOCK TO BE FREED
	ELMT%%	MXBF,1;;		MAX-BLOCKING-FACTOR
	ELMT%%	DRTAB,1;;		LOC OF DATA REC-TABLE
	ELMT%%	LRWA,1;;		LAST RECORD WORD OF AUXBUF
;;**EDIT 333	ILG	31-MAY-74
	ELMT%%	CORPT.,1;;		[346] FREE CORE POINTER.
	ELMT%%	HLOTC.,1;;		HIGH,,LOW LIMITS ON CORE
;;					 BETWEEN .JBFF AND THE OVERLAY AREA.
	ELMT%%	OTCPT.,1;;		POINTER TO FREE CORE IN HLOTC.
	ELMT%%	RUN.TM,1;;		[346] INITIAL RUN TIME.

	ELMT%%	CB.DDT,1;;		NONE-ZERO IF COBDDT IS PRESENT
	ELMT%%	SBPSA.,1;;		SUBPROGRAM'S STARTING ADDRESS
	ELMT%%	%F.PTR,1;;		POINTS TO POINTER TO FILES. I.E. XWD %LIT00,%FILES
	ELMT%%	INTBLK,4;;		; [414] INTERRUPT BLOCK.

	;;LOCATIONS MOVED FROM FIXED AREA FOR RPGII
	ELMT%%	USES.,1;;		USES.
	ELMT%%	HLOVL.,1;;		HIGH,,LOW LIMITS ON FREE CORE
	ELMT%%	KEYCV.,1;;

	;;THE FS.??? VARIABLES ARE FOR CBLIO ERROR RECOVERY
	ELMT%%	FS.ZRO,1;;		THE BLT ZERO WORD - FS.FS TO FS.IF
	ELMT%%	FS.FS,1;;		FILE-STATUS WORD
	ELMT%%	FS.EN,1;;		ERROR-NUMBER
	ELMT%%	FS.BN,1;;		BLOCK-NUMBER
	ELMT%%	FS.RN,1;;		RECORD-NUMBER
	ELMT%%	FS.UPD,1;;		USER-PROCEDURE-DONE FLAG
	ELMT%%	FS.IGE,1;;		IGNORE-ERROR FLAG
	ELMT%%	FS.IF,1;;		IDX-FILE VS IDA
	ELMT%%	FS.IEC,1;;		IGRORED ERROR COUNT

	; ARGUMENT BLOCK FOR THE FILOP. UUO
	ELMT%%	FOP.BK,1;;		CHANNEL ,, FUNCTION
	ELMT%%	FOP.IS,1;;		IO STATUS BITS
	ELMT%%	FOP.DN,1;;		DEVICE NAME
	ELMT%%	FOP.BH,1;;		ADR OF BUFFER HEADERS
	ELMT%%	FOP.BN,1;;		NUMBER OF BUFFERS
	ELMT%%	FOP.LB,1;;		ADR OF LOOKUP BLOCK
	ELMT%%	FOP.PP,1;;		PATH POINTER

	ELMT%%	NRSAV.,4;;	TEMP STORAGE FOR D.BPNR,FS.RN,D.RP AND D.RCL

	ELMT%%	DELSIZ,1;;	DELIMITER SIZE
	ELMT%%	LNKNO.,1;;	LINK# ARGUMENT TO REMOVL (CANCEL)
	ELMT%%	RELEN.,1;;	SIZE OF RELEASED RECORD FOR STANDALONE SORT

;ARGUMENT BLOCK FOR DEC-SYS-20 COMPT. UUO

	ELMT%%	CP.BLK,1;;		ARG ,, FUNCTION
	ELMT%%	CP.BK1,1
	ELMT%%	CP.BK2,1
	ELMT%%	CP.BK3,1
	ELMT%%	CP.BK4,1
	ELMT%%	CP.BK5,1
	ELMT%%	CP.BK6,1
	ELMT%%	CP.BK7,1

	ELMT%%	FID.BK,15

;	TEMPORARY STORAGE FOR SIMULTANEOUS UPDATE
;
;
	ELMT%%	SU.RR;;		COUNT OF RECORDS RETAINED BY THE USER
	ELMT%%	SU.EQ;;		COUNT OF ENTRIES IN THE ENQUEUE TABLE
				;(AS OPPOSED TO THE DEQUEUE TABLE OR
				;(THE MODIFY TABLE)
	ELMT%%	SU.DQ;;		COUNT OF ENTRIES IN THE DEQUEUE TABLE
	ELMT%%	SU.MQ;;		COUNT OF ENTRIES IN THE MODIFY TABLE
	ELMT%%	SU.RRT;;		LOCATION OF THE RETAINED RECORDS TABLE
	ELMT%%	SU.T1;;		TEMP ONE
	ELMT%%	SU.T2;;		TEMP TWO
	ELMT%%	SU.T3;;		TEMP THREE
	ELMT%%	SU.T4;;		TEMP FOUR
	ELMT%%	SU.T5;;		TEMP FIVE
	ELMT%%	SU.T6;;		TEMP SIX
	ELMT%%	SU.T7;;		TEMP SEVEN
	ELMT%%	SU.T8;;		TEMP EIGHT
	ELMT%%	SU.CRH;;		USED TO STORE THE HIGHEST VALUE OF ACRR
				;(TOTAL LENGTH OF THE RETAINED RECORDS 
				;TABLE)
	ELMT%%	SU.EQT;;		LOCATION OF THE ENQUEUE TABLE
	ELMT%%	SU.DQT;;		LOCATION OF THE DEQUEUE TABLE
	ELMT%%	SU.MQT;;		LOCATION OF THE MODIFY TABLE
	ELMT%%	SU.Y;;		FLAG
	ELMT%%	SU.RBP;;		RECORD BYTE POINTER - SPECIAL POINTER
				;TO HANDLE LOW-VALUES (SEE CBLIO 
				;INTERFACE)
	ELMT%%	SU.MRR;;		MORE RETAINED RECORDS FLAG
	ELMT%%	SU.SBD;;		SAME BLOCK, DIFFERENT QUEUEING 
				;TECHNIQUE FLAG
	ELMT%%	SU.SFQ;;		SAME FILE FLAG
	ELMT%%	SU.SFS;;		SAME FILE, SAME QUEUEING TECHNIQUE FLAG
	ELMT%%	SU.SBS;;		SAME BLOCK, SAME QUEUEING TECHNIQUE
				;FLAG
	ELMT%%	SU.NR;;		NOT RETAINED FLAG

	ELMT%%	SU.FR;;		COUNT OF FILES CURRENTLY OPENED FOR
				;SIMULTANEOUS UPDATE

	ELMT%%	SU.AK;;		TEMPORARY USED FOR ABSOLUTE KEY

	ELMT%%	SU.FBT;;		LOCATION OF THE FILL/FLUSH BUFFER TABLE

	ELMT%%	SU.CFB;;		COUNT OF ENTRIES IN THE FILL/FLUSH
				;BUFFER TABLE

	ELMT%%	SU.VRB;;		INDICATOR OF CURRENT VERB BEING EXECUTED
				;10 = READ, 4 = REWRITE, 2 = WRITE, 1 = DELETE

	ELMT%%	SU.CK;;		COMPARISON KEY

	ELMT%%	SU.SVK;;		TEMP USED TO SAVE KEY

	ELMT%%	SU.CL1;;
	ELMT%%	SU.CL2;;
	ELMT%%	SU.CLR;;
	ELMT%%	SU.CLS;;	TEMPS FOR SU.CL -
				;SU.CL1 AND SU.CL2 MUST BE
				;CONTIGUOUS

	ELMT%%	SU.SAV,5;;		AREA TO SAVE REGISTERS 1,2,3,0, AND 12


	ELMT%%	FET1,1;;	FILE ENQUEUE TEMP ONE
	ELMT%%	FET2,1;;	FILE ENQUEUE TEMP TWO
	ELMT%%	FET3,1;;	FILE ENQUEUE TEMP THREE
	ELMT%%	FET4,1;;	FILE ENQUEUE TEMP FOUR

	ELMT%%	SU.FRF;;	FAKE READ FLAG FOR LSU/CBLIO COMMUNICATION

;POINTER TO USER'S LIBOL ROUTINE'S LOW SEGMENT DATA AREA.

	ELMT%%	USRLO.;;

IFN BIS,<

	ELMT%%	MRKPTR,2;;	MARK POINTER STORAGE
>

;;IMPURE STORAGE FOR MCS
IFN MCS,<
	ELMT%%	SNDMSG,10;;	STORAGE FOR LCMIPC
	ELMT%%	MCSTN,1;;		TRANSACTION NUMBER
	ELMT%%	M.TMP1,1;;	DESTINATION COUNT,,TEXT LENGTH
	ELMT%%	M.TMP2,1
	ELMT%%	M.ATCT,1;;	ACTIVE TRANSACTION COUNT
	ELMT%%	MCSPT,1;;		PAGE TABLE POINTER
	ELMT%%	PIDMCP,1;;	PID OF MCP
	ELMT%%	PIDLCM,1;;	OUT PID
	ELMT%%	IPCFLG,1;;	NEXT PACK IN INPUT QUEUE
	ELMT%%	PAKSND,4;;	SEND PACKET
	ELMT%%	MSGSND,10;;	MESSAGE SEND
	ELMT%%	PAKREC,4;;	RECEIVE PACK
	ELMT%%	MSGREC,10;;	MESSAGE RECEIVED
;;
;;FREE PAGE BIT TABLE
;;EACH BIT REPRESENTS A PAGE ON FREE CORE
;;0=PAGE AVAILABLE
;;1=PAGE IS IN USE
	ELMT%%	PAGOFF,1;;	OFFSET TO THE PAGE TABLE
	ELMT%%	PAGBIT,1;;	PAGE TABLE FOR FREE TABLES
	>
;	IMPURE STORAGE FOR RPGII
;
;


	ELMT%%	INDBAS,10			;; INDICATORS
	ELMT%%	AITCH,1				;; HEADING FLAG
	ELMT%%	DEE,1				;; DETAIL FLAG
	ELMT%%	TEE,1				;; TOTAL FLAG
	ELMT%%	ECKS,1				;; EXCEPTION FLAG
	ELMT%%	READF,1				;; READ FLAG
	ELMT%%	WRITF,1				;; WRITE FLAG
	ELMT%%	CURREC,1			;; CURRENT RECORD
	ELMT%%	CUROCH,1			;; CURRENT OCHTAB ENTRY
	ELMT%%	CURICH,1			;; CURRENT ICHTAB ENTRY
	ELMT%%	CUROTF,1			;; CURRENT OTFTAB ENTRY
	ELMT%%	CURRII,1			;; CURRENT RII
	ELMT%%	CURCHN,1			;; CURRENT CHNTAB POINTER
	ELMT%%	CURARR,1;;			;; current ARRTAB pointer
	ELMT%%	CURARP,1;;			;; current alternate ARRTAB pointer
	ELMT%%	CHNBAS,1			;; BASE ADDRESS OF CHNTAB
	ELMT%%	FOVTIM,1			;; FORCED OVERFLOW
	ELMT%%	OVTIM,1				;; OVERFLOW TIME
	ELMT%%	OVIND,1				;; OVERFLOW INDICATOR
	ELMT%%	BRKCNT,1			;; COUNT OF CONTROL BREAKS
	ELMT%%	PPN,1				;; RUNNER'S PPN
	ELMT%%	SELFIL,1			;; SELECTED FILE
	ELMT%%	NUMINP,1			;; NUMBER OF INPUT FILES
	ELMT%%	BLTHLD,1			;; TEMP HOLDER FOR A BLT
	ELMT%%	MATFIL,1			;; CURRENT MATCH FILE
	ELMT%%	HICLI,1				;; HIGHEST CLI
	ELMT%%	FILEXT,1			;; FILE EXTENSION
	ELMT%%	WEIRD,1				;; ODDBALL FLAG
	ELMT%%	KEYFLG,1			;; A KEY FLAG
	ELMT%%	BINRED,1			;; [136] file has been read flag
	ELMT%%	LOKEY,1				;; LOWEST VALID KEY
	ELMT%%	HIKEY,1				;; HIGHEST VALID KEY
	ELMT%%	MATCNT,1			;; COUNT OF MATCHES
	ELMT%% 	FSTTIM,1			;; FIRST TIME FLAG
	ELMT%%	XFOTF,1				;; TEMP FOR XFIL
	ELMT%%	MINUS,1				;; THIS IS MINUS NUM
	ELMT%%	NZERO,1				;; THIS IS NOT ZERO NUM
;;[136]	ELMT%%	OPNIN,1				;; OPEN FOR INPUT FLAG
;;[136]	ELMT%%	OPNOUT,1			;; OPEN FOR OUTPUT FLAG
	ELMT%%	COMBO,1				;; COMBINED OUTPUT FLAG
	ELMT%%	SAVINP,17			;; SAVER OF INPUT FILES
	ELMT%%	LPSBUF,^D27			;; SAVER OF LPT BUFFERS
	ELMT%%	KEYBUF,5			;; SAVER OF KEYS
	ELMT%%	UOCAL.,1			;; SAVER OF UUO'S
	ELMT%%	BLNKAF,1			;; EDIT BLANK AFTER FLAG
	ELMT%%	CHOUNT,1			;; EDIT CHARACTER COUNT
	ELMT%%	FILL,1				;; EDIT FILL CHARACTER
	ELMT%%	EDBUF,5				;; EDIT BUFFER
	ELMT%%	MSKBUF,5			;; EDIT MASK BUFFER
	ELMT%%	UDAY,1				;; CURRENT DAY
	ELMT%%	UMON,1				;; CURRENT MONTH
	ELMT%%	UYEAR,1				;; CURRENT YEAR
	ELMT%%	UDATE,1				;; CURRENT DATE
	ELMT%%	PAGE,1				;; PAGE COUNTER
	ELMT%%	PAGE1,1				;; PAGE COUNTER
	ELMT%%	PAGE2,1				;; PAGE COUNTER
	ELMT%%	TODTMP,1			;; temp used by the time routines
	ELMT%%	RIIPDL,21;;			;; RII push-down list and pointer
	ELMT%%	DOVPDL,12;;			;; [174] detail overflow pushdown list
	ELMT%%	DIDFET,1;;			;; [174] flag for fetch done
	ELMT%%	INDET,1;;			;; [174] flag for detail calcs
	ELMT%%	.SVI,1;;			;; [176] save ptr for ov inds
	ELMT%%	.SVIND,1;;			;; [176] save ptr for ov inds
	ELMT%%	.OA,^D8;;			;; [176] secondary indicators
	ELMT%%	.EDOCC,1;;			;; number of occurs storage for EDIT
	ELMT%%	.EDIDX,1;;			;; index storage for EDIT
	ELMT%%	.SVCH,1;;			;; place to stash CH for PD
	ELMT%%	MFLAST,1;;			;; the last input hopper used
	ELMT%%	MFOREC,1;;			;; output stacker containing record
	ELMT%%	MFOTF,4;;			;; table of OTFTAB pointers for stackers
	ELMT%%	MFINST,1;;			;; input stacker select
	ELMT%%	.MPTAB,^D9;;			;; table of pointers into .CM and .OM
	ELMT%%	.MFTAB,^D9;;			;; table of flags for .CM and .OM
	ELMT%%	.MATTB,1;;			;; pointer to .OM or .CM pointers
	ELMT%%	.MATEQ,1;;			;; match records equal flag
	ELMT%%	.OMVAL,1;;			;; .OM is valid flag
	ELMT%%	.CM1,^D10;;			;; current contents of M1 field
	ELMT%%	.CM2,^D10;;			;; current contents of M2 field
	ELMT%%	.CM3,^D10;;			;; current contents of M3 field
	ELMT%%	.CM4,^D10;;			;; current contents of M4 field
	ELMT%%	.CM5,^D10;;			;; current contents of M5 field
	ELMT%%	.CM6,^D10;;			;; current contents of M6 field
	ELMT%%	.CM7,^D10;;			;; current contents of M7 field
	ELMT%%	.CM8,^D10;;			;; current contents of M8 field
	ELMT%%	.CM9,^D10;;			;; current contents of M9 field
	ELMT%%	.OM1,^D10;;			;; previous contents of M1 field
	ELMT%%	.OM2,^D10;;			;; previous contents of M2 field
	ELMT%%	.OM3,^D10;;			;; previous contents of M3 field
	ELMT%%	.OM4,^D10;;			;; previous contents of M4 field
	ELMT%%	.OM5,^D10;;			;; previous contents of M5 field
	ELMT%%	.OM6,^D10;;			;; previous contents of M6 field
	ELMT%%	.OM7,^D10;;			;; previous contents of M7 field
	ELMT%%	.OM8,^D10;;			;; previous contents of M8 field
	ELMT%%	.OM9,^D10;;			;; previous contents of M9 field
	ELMT%%	.CKSPC,1;;			;; [147] skip/space pointer

IFN STATS,<
	ELMT%%	%TIME0,1			; STARTING TIME
	ELMT%%	%TIME1,1			; TEMP STARTING TIME
	ELMT%%	%TIMER,1			; ELAPSED TIME IN RUNTIME SYS
	ELMT%%	%TIMEP,1			; ELAPSED TIME IN PROGRAM
	ELMT%%	%RTIM0,1			; STARTING CPU TIME
	ELMT%%	%RTIM1,1			; TEMP STARTING CPU TIME
	ELMT%%	%RTIM2,1			; TEMP STARTING CPU TIME FOR INDC ROUTINES
	ELMT%%	%RTIMR,1			; CPU TIME USED IN RUNTIME SYS
	ELMT%%	%RTIMP,1			; CPU TIME USED IN PROGRAM
	ELMT%%	%RTIMI,1			; CPU TIME USED IN INDC ROUTINE
	ELMT%%	%RTIMC,1			; CPU TIME USED IN CKIND ROUTINE
	ELMT%%	%INDC,1				; NUMBER OF TIMES INDC CALLED
	ELMT%%	%INDCT,1			; NUMBER OF TIMES INDC WAS TRUE
	ELMT%%	%INDC2,1			; NUMBER OF TIMES CKIND WAS CALLED
	>

	>		;END OF NON-PRESET AREA
SUBTTL	LIBOL DISPATCH TABLE
	DEFINE	DISTB%	<

	DISEL%	RESET.
	DISEL%	A.01
	DISEL%	D.00
	DISEL%	INDC.

	>	;END OF DISPATCH TABLE
SUBTTL	RANDOM USEFUL MACROS

;DEFINITION OF LIBOL LOW SEGMENT

DEFINE	%LOSEG	<
	VISBL%		;;EXTERNALLY VISABLE SECTION
	INFBK%		;;FIXNUM BLOCK
	PREST%	;;PRESET AREA
	LIDAT%		;;NON-PRESET AREA
>

;DEFINE A BLOCK STATEMENT WITHOUT REGARD TO VALUE

DEFINE	BLKDF	(NAME,LEN<1>)	<
	IFNB	<NAME>,<NAME::>
	BLOCK	LEN
>

;DEFINE A BLOCK STATEMENT OR VALUE

DEFINE	BLKDFV	(NAME,LEN<1>,VAL)	<
	IFNB	<NAME>,<NAME::>
	IFN	LEN,<IFB	<VAL>,<BLOCK	LEN>
		    IFNB	<VAL>,<REPEAT	LEN,<
					VAL>>
		>
>

;MACRO TO DEFINE A SYMBOL

DEFINE	SYM%%	(NAME,VAL)	<NAME==:VAL>

SUBTTL	MACROS FOR LIBSHR.MAC

;DEFINE THE BEGINNING OF THE LIBOL.SHR HIGH SEGMENT

DEFINE	PURHI%	<

	;;FIRST THE DISPATCH TABLE
	DEFINE	DISEL%	(NAM)	<JRST	1,NAM##>	;;PORTALS
	DEFINE	DSTBL%	(NAM,IR)	<JRST	1,@NAM##(IR)>
	RELOC	400000			;;START AT THE TOP
	DISTB%				;;DISPATCH TABLE

	;; NOW THE VALUES TO BE BLT INTO THE LIBOL.LOW PRESET AREA
	DEFINE	SYMH%%	(N%,V)	<SYM%%	N%,V>	;;ONLY HIGH SEG SYMBOLS
	DEFINE	SYML%%	(N%,V)	< >		;;NO LOW SEG SYMBOLS
	DEFINE	ELMT%%	(N%,L<1>,V)	<BLKDFV	,L,<V>>	;;GET THE VALUES ONLY
	PREST%				;;PRESET SECTION

	PURGE	ELMT%%,SYMH%%,SYML%%,DISEL%,DSTBL%
>

;NOW THE LOW SEGMENT WITH NO VALUES

DEFINE	PURLO%	<

	DEFINE	ELMT%%	(N%,L<1>,V)	<BLKDF	N%,L>	;;JUST SYMBOLS
	LOC	LO.PUR			;;ACTUAL LOSEG STARTING ADDRESS
	DEFINE	SYML%%	(N%,V)	<SYM%%	N%,V>	;;LO SEG SYMBOLS ONLY
	DEFINE	SYMH%%	(N%,V)	< >	;;NO HIGH SEG SYMBOLS

	%LOSEG			;;LO SEG DEFINITIONS

	COMCHK	.-LO.PUR	;; HAVE WE EXCEEDED MAX LOSEG SIZE

	PURGE	ELMT%%,SYMH%%,SYML%%
>

SUBTTL	MACROS FOR IMPURE LOSEG - LIBREL.MAC

;IMPURE LOSEGMENT WITH VALUES PRESET AT LOAD TIME

DEFINE	IMPLO%	<
	
	DEFINE	SYMH%%	(N%,V)	<N%==:0>	;;SET TO ZERO TO CANCEL BLT
	DEFINE	SYML%%	(N%,V)	<SYM%%	N%,V>	;;DO LOSEG SYMBOLS
	DEFINE	ELMT%%	(N%,L<1>,V)	<BLKDFV	N%,L,<V>>	;;WITH VALUES

	RELOC	0
	CHK==.

	%LOSEG

	COMCHK	.-CHK		;;HAVE WE EXCEEDED THE MAX LOW SEG SIZE

	PURGE	SYML%%,SYMH%%,ELMT%%
>

; THERE IS NO DISPATCH TABLE WHEN LIBOL.SHR IS NOT USED

SUBTTL	COBOL PROGRAM INTERFACE MACROS

;THESE ARE REFERENCED BY LILOWS.MAC
;THEY WILL DEFINE THE ADDRESSES OF THE DISPATCH TABLE
;AND ADDRESSES OF SELECTED LOW SEGMENT LOCATIONS

;DISPATCH TABLE ADDRESSES

DEFINE	DISAD%	<
	ADR==HI.PUR	;;ACTUAL HIGH SEG BEGINNING ADDRESS
	DEFINE	DISEL%	(N%)	<
	N%==:ADR
	ADR==ADR+1
	>
	DEFINE	DSTBL%	(NAM,IR)	<DISEL%	(NAM)>

	DISTB%				;;DEFINE ADDRESSES

	PURGE	DISEL%,DSTBL%,ADR
>

;MACRO TO DEFINE SELECTED LOW SEGMENT ADDRESSES

DEFINE	LOWAD%		<
	DEFINE	SYMH%%	(N%,V)	< >
	DEFINE	SYML%%	(N%,V)	< >
	DEFINE	ELMT%%	(N%,L<1>,V)	<BLKDFV	N%,L,<V>>
	LOC	LO.PUR			;ACTUAL LO SEG STARTING ADDRESS

	VISBL%


	COMCHK	.-LO.PUR	;;HAVE WE EXCEEDED MAX LO SEG SIZE?

	PURGE	ELMT%%,SYMH%%,SYML%%,ADR
>

SUBTTL	COMPILER INFORMATION

;COMSIZ IS THE AMOUNT OF SPACE ALLOCATED BY THE COMPILER
;FOR THE RPGLIB LOW SEGMENT
;IF THIS NUMBER IS EXCEEDED BY EXPANDING THE LOW SEG THEN
;RPGIIG.MAC MUST BE RECOMPILED AND THE COMPILER RELOADED
;NOTE THAT ALL PREVIOUSLY COMPILED PROGRAMS WILL BE INCOMPATABLE
;WITH THE NEW LARGER RPGLIB.SHR

COMSIZ==1600

;TELL SOMEONE IF COMSIZ HAS BEEN EXCEEDED

DEFINE	COMCHK	(LEN)	<
	IFG	LEN-COMSIZ,<PRINTX	?COMSIZ EXCEEDED - REGENERATE THE COMPILER>
>

;INDICES OF THE INFORMATION HEADER BLOCK

DEFINE	INFIX%		<
	INC==0		;STARTING INDEX
	DEFINE	ELMT%%	(N%,L<1>,V)	<
	IFNB	<N%>,<%'N%==:INC>
	INC==INC+1
	>
	INFBK%

	PURGE	ELMT%%,INC

>

; DEFINE THEM
	INFIX%

	END