Google
 

Trailing-Edge - PDP-10 Archives - BB-H311B-RM - rsx20f-swskit/listings/rsxmac.lis
There are no other files named rsxmac.lis in the archive.
;
; CSI MACRO DEFINITIONS
;
;                             COPYRIGHT (C) 1975, 1978 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 THERE-
;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;       THE INFORMATION CONTAINED 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 SUPPILED BY DIGITAL.
;
; VERSION 02
;
; WRITTEN BY:
;	A. MAROTTO
;
; MODIFIED BY:
;	C.A. D'ELIA	11-NOV-73
;	C.A. D'ELIA	04-JUN-74
;
;
 
;
; CSI$1 - CALL COMMAND STRING SYNTAX ANALYZER
;
 
	.MACRO	CSI$1 CSBLK,BUFF,LEN
	.GLOBL	.CSI1
	.MCALL	CSI$,LDR0$
	.IF NDF C.SIZE
	CSI$
	.ENDC
	LDR0$	CSBLK
	.IF NB	<BUFF>
	MOV	BUFF,C.CMLD+2(R0)
	.ENDC
	.IF NB	<LEN>
	MOV	LEN,C.CMLD(R0)
	.ENDC
	JSR	PC,.CSI1
	.ENDM
 
 
 
 
;
; CSI$2 - CALL COMMAND STRING SEMANTIC PARSER
;
 
	.MACRO	CSI$2 CSBLK,IO,SWTAB
	.GLOBL	.CSI2
	.MCALL	CSI$,LDR0$
	.IF NDF C.SIZE
	CSI$
	.ENDC
	LDR0$	CSBLK
	.IF NB	<IO>
	.IF IDN	<INPUT>,<IO>
	MOVB	#CS.INP,(R0)
	.IFF
	.IF IDN	<OUTPUT>,<IO>
	MOVB	#CS.OUT,(R0)
	.IFF
	.ERROR	;INCORRECT REQUEST TO .CSI2  ;
	.ENDC
	.ENDC
	.ENDC
	.IF NB	<SWTAB>
	MOV	SWTAB,C.SWAD(R0)
	.ENDC
	JSR	PC,.CSI2
	.ENDM
 
 
 
 
;
; CSI$SW - DEFINE SWITCH TABLE ENTRY
;
 
	.MACRO	CSI$SW	SW,MK,MKW,CLR,NEGS,VALTAB
$$=.
	.IF	NB	SW
	.ASCII	/SW/
	.IFF
	.ERROR	;MISSING SWITCH NAME  ;
	.ENDC
.=$$+2
	.IF	NB	MK
	.WORD	MK
	.IFF
	.WORD	0
	.ENDC
$$=0
	.IF	NB	CLR
	.IF	IDN	<CLEAR>,<CLR>
$$=1
	.IFF
	.IF	IDN	<SET>,<CLR>
	.IFF
	.ERROR	;INVALID SET/CLEAR SPEC  ;
	.ENDC
	.ENDC
	.ENDC
	.WORD	MKW+$$
$$=0
	.IF	NB	NEGS
	.IF	IDN	<NEG>,<NEGS>
$$=1
	.IFF
	.ERROR	;INVALID NEGATE SPEC  ;
	.ENDC
	.ENDC
	.WORD	VALTAB+$$
	.ENDM
 
 
 
 
;
; CSI$ND - SWITCH/VALUE TABLE END
;
 
	.MACRO	CSI$ND
	.WORD	0
	.ENDM
 
 
 
 
;
; CSI$SV - DEFINE SWITCH VALUE TABLE ENTRY
;
 
	.MACRO	CSI$SV	TYPE,ADDR,LEN,VALTAB
	.IF	NB	VALTAB
VALTAB:
	.ENDC
	.IF	NB	TYPE
	.IF	IDN	<ASCII>,<TYPE>
	.BYTE	1
	.IFF
	.IF	IDN	<NUMERIC>,<TYPE>
	.BYTE	2
	.IFF
	.IF	IDN	<OCTAL>,<TYPE>
	.BYTE	2
	.IFF
	.IF	IDN	<DECIMAL>,<TYPE>
	.BYTE	3
	.IFF
	.ERROR	;INVALID CONVERSION TYPE  ;
	.ENDC
	.ENDC
	.ENDC
	.ENDC
	.IFF
	.BYTE	1	;ASCII CONVERSION ASSUMED
	.ENDC
	.IF	NB	LEN
	.BYTE	LEN
	.IFF
	.ERROR	;LENGTH MISSING  ;
	.BYTE	0
	.ENDC
	.IF	NB	ADDR
	.WORD	ADDR
	.IFF
	.ERROR	;VALUE ADDRESS MISSING  ;
	.WORD	0
	.ENDC
	.ENDM
 
 
 
 
;
; LDR0$ - CONDITIONALLY LOAD R0
;
 
	.MACRO	LDR0$	ARG
	.IIF	B,ARG,.MEXIT
	.NTYPE	PAR$$$,ARG
	.IIF	EQ,PAR$$$,.MEXIT
	MOV	ARG,R0
	.ENDM
 
 
 
 
;
; CSI$ - COMMAND STRING INTERPRETER SYMBOL DEFINITIONS
;
 
	.MACRO	CSI$	GBL
	.IF IDN <GBL>,<DEF$G>
.GLOBL	C.TYPR,C.STAT,C.CMLD,C.DEVD,C.DIRD,C.FILD,C.SWAD,C.MKW1,C.MKW2
.GLOBL	C.SIZE,C.DSDS,CS.INP,CS.OUT
.GLOBL	CS.NMF,CS.DIF,CS.DVF,CS.WLD,CS.MOR,CS.EQU
	.ENDC
;
C.TYPR	=0	;REQUEST TYPE(FOR CSI2)
C.STAT	=1	;STATUS(FROM CSI2)
C.CMLD	=2	;LENGTH OF COMMAND STRING BUFFER
		;ADDRESS OF COMMAND STRING BUFFER
C.DEVD	=6	;LENGTH OF DEVICE NAME STRING
		;ADDR OF MOST RECENT DEVICE NAME STRING
C.DIRD	=12	;LENGTH OF MOST RECENT DIR INFO
		;ADDRESS OF DIR INFO
C.FILD	=16	;LENGTH APPROPRIATE TO C.FILD+2
		;CSI1 - ADDR OF STRING SEG WHERE ERROR OCCURED
		;CSI2 - ADDR OF FILE NAME FOR CURRENT REQUEST
C.SWAD	=22	;ADDR OF CURRENT SWITCH TABLE
C.MKW1	=24	;'OR' OF MASKS FOR ALL SWITCHES FOUND THIS CALL
C.MKW2	=26	;ON/OFF SETTINGS OF MASKS FOR SWITCHES FOUND
;
C.SIZE	=54	;SIZE OF CSI CONTROL BLOCK(IN BYTES)
;
C.DSDS	=C.DEVD	;DISP TO 6 WORD BLOCK FOR FCS
;
;	C.TYPR VALUES
;
CS.INP	=1	;REQUEST INPUT STRING
CS.OUT	=2	;REQUEST OUTPUT STRING
;
;	C.STAT VALUES
;
CS.NMF	=1	;1=FILE NAME SPECIFIED THIS SEG OF STRING
CS.DIF	=2	;1=DIR INFO SPECIFIED THIS SEG OF STRING
CS.DVF	=4	;1=DEVICE NAME SPECIFIED THIS SEG OF STRING
CS.WLD	=10	;FILE NAME HAS WILD CARD SWITCH
CS.MOR	=20	;MORE STRING SEGS FOLLOW
CS.EQU	=40	;EQUAL SIGN SEEN BY CSI1
;
; MACRO REDEFINITION
;
	.MACRO	CSI$	X
	.ENDM	CSI$
 
	.ENDM	CSI$
;                             COPYRIGHT (C) 1976, 1978 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 THERE-
;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;       THE INFORMATION CONTAINED 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 SUPPILED BY DIGITAL.
; MODIFIED 12-OCT-75 /RAB
;	ADDED DEFINITION OF "EPTR" FOR KL EPT RELATIVE EXAMINES AND DEPOSITS
;	25-AUG-77
;	ADDED DEFINITION FOR KL POWER FAIL BIT (KLPWRF)
	.MACRO	$DEF
PS=177776		;PROCESSOR STATUS REGISTER
CS.EXP=177670		;SENSE SWITCHES
SWR=177570		;FRONT PANEL SWITCH REGISTER
PR0=0*40		;PRIORITY LEVEL 0
PR1=1*40		;PRIORITY LEVEL 1
PR2=2*40		;PRIORITY LEVEL 2
PR3=3*40		;PRIORITY LEVEL 3
PR4=4*40		;PRIORITY LEVEL 4
PR5=5*40		;PRIORITY LEVEL 5
PR6=6*40		;PRIORITY LEVEL 6
PR7=7*40		;PRIORITY LEVEL 7
BIT0=000001
BIT1=000002
BIT2=000004
BIT3=000010
BIT4=000020
BIT5=000040
BIT6=000100
BIT7=000200
BIT8=000400
BIT9=001000
BIT10=002000
BIT11=004000
BIT12=010000
BIT13=020000
BIT14=040000
BIT15=100000
HIBYTE=177400
;
;	DIRECTIVE FUNCTION CODES
;
DR.DTE=9.	;DTE EXAMINE/DEPOSIT/INITALIZE/DOORBELL FUNCTIONS
;
;	DTE FUNCTION CODES (LOW ORDER BY BYTE)
;
DF.DOR=1	;DOOR BELL FUNCTION CODE
DF.OFF=2	;DTE OFF FUNCTION
DF.ON=3		;DTE ON FUNCTION
DF.DMG=4	;DEPOSIT MY GENERAL FUNCTION
DF.EMG=5	;EXAMINE MY GENERAL FUNCTION
DF.EMN=6	;EXAMINE MY FOR N FUNCTION
DF.DMN=7	;DEPOSIT MY FOR N FUNCTION
DF.EHG=10	;EXAMINE HIS GEN SECTION FUNCTION
DF.EHM=11	;EXAMINE HIS SECTION FOR ME FUNCTION
DF.KLR=12	;DIAGNOSTIC KL READ
DF.KLW=13	;DIAGNOSTIC KL WRITE (FUNCTION 13)
DF.KLX=14	;DIAGNOSTIC KL EXECUTE (FUNCTION 14)
DF.PEX=15	;PRIVILEDGED EXAMINE (FUNCTION 15)
DF.PDP=16	;PRIVILEDGED DEPOSIT (FUNCTION 16)
;
;	GENERAL PROCESSOR DEFINITIONS
;
PRI7=340	;PROCESSOR PRIORITY 7
;
;
;	DTE20 REGISTER DEFINITIONS
;
;	THESE LABELS ARE THOSE USED IN THE FRONT END INTERFACE SPEC
;	EXCEPT STATUS WHICH CONFLICTS WITH PROTOCOL SPEC
;
;	PDM# 200-200-012-00
;
;
DLYCNT=174400	;DELAY COUNT WORD
DEXWD3=174402	;DEPOSIT OR EXAMINE WORD 3
DEXWD2=174404	;DEPOSIT OR EXAMINE WORD 2
DEXWD1=174406	;DEPOSIT OR EXAMINE WORD 1
TENAD1=174410	;TEN ADDRESS WORD 1
TENAD2=174412	;TEN ADDRESS WORD 2
TO10BC=174414	;TO-10 PDP-11 MEMORY ADDRESS
TO11BC=174416	;TO-11 BYTE COUNT
TO10AD=174420	;TO-10 PDP-11 MEMORY ADDRESS
TO11AD=174422	;TO-11 PDP-11 MEMORY ADDRESS
TO10DT=174424	;TO-10 PDP-11 DATA WORD
TO11DT=174426	;TO-11 PDP-11 DATA WORD
DIAG1=174430	;DIAGNOSTIC WORD 1
DIAG2=174432	;DIAGNOSTIC WORD 2
STAT=174434	;STATUS WORD
DIAG3=174436	;DIAGNOSTIC WORD 3
;
;
;	EXTERNAL PAGE DEFINITIONS (DEVICE DEFINITIONS)
;
;
;	DTE DEFINITIONS
;
;
;	REGISTER BIT DEFINITIONS
;
;
;	TENAD1 DEFINITIONS
;
DEP=010000	;DEPOSIT (BIT 12)
PRTOFF=004000	;EXAMINE/DEPOSIT PROTECT OFF 
PHYS=100000	;PHYSICAL EXAMINE
EPTR=0		; EPT RELATIVE DEPOSIT / EXAMINE
;
;	TO11BC DEFINITIONS
;
IFLOP=100000	;I FLIPFLOP BIT
ZSTOP=040000	;ZSTOP
TO11BM=020000	;TO 11 BYTE MODE
;
;	DIAG1 DEFINITIONS
;
DS04=004000	;KL CLOCK ERROR STOP
DS05=002000	;RUN
DS06=001000	;HALT
DEX=000400	;DEPOSIT OR EXAMINE MAJOR STATE
TO10=000200	;TO 10
DFUNC=000200
TO11=000100	;TO-11 TRANSFER MAJOR STATE
D1011=000040	;DIAGNOSE 10/11 INTERFACE
PULSE=000020	;SINGLE CLOCK CYCLE
DIKL10=00010	;DIAGNOSTIC MODE SWITCH
DSEND=000004	;SEND DATA
DCOMST=000001	;DIAGNOSTIC COMMAND START
;
;	DIAG1 FUNCTIONS
;
.STPCL=0		;STOP THE KL CLOCK
.STRCL=01*1000		;START THE KL CLOCK
.SSCLK=02*1000		;SINGLE STEP THE M BOX CLOCK
.SECLK=03*1000		;SINGLE STEP THE  EBOX CLOCK. LEAVES THE
			;EBOX CLOCK FALSE AND EBOX SYNC TRUE.
			;CAUSES (2,3) MBOX CLOCKS DEPENDING ON
			;EBOX CLOCK INITIALLY (FALSE,TRUE).
			;DOES NOT DEPEND ON 'T' FIELD OR MB WAIT.
.CECLK=04*1000		;CONDITIONALLY ISSUE AN EBOX CLOCK IF THE EBOX
			;CLOCK IS TRUE.  MAKES EBOX CLOCK FALSE.
			;IF ISSUED IN THE MASTER RESET STATE.
			;LEAVES EBOX SYNC TRUE.
.BRCLK=05*1000		;ISSUE A BURST OF THE CLOCKS.  THE NUMBER
			;OF MBOX CLOCKS DESIRED (1-255) HAS BEEN
			;BEEN LOADED PREVIOUSLY BY FUNCTIONS LDBRR,LDBRL
			;(42,43)
.CLRMR=06*1000		;CLEAR MASTER RESET STATE
.SETMR=07*1000		;SET MASTER RESET STATE. RUNNING THE CLOCK WHILE IN THIS
			;STATE 'CLEARS' THE KL10.
.CLRUN=10*1000		;CLEAR THE RUN FLOP.  MAKE THE MICRO CODE GO TO
			;THE HALT-LOOP.
.SETRN=11*1000		;SET THE RUN FLOP.  ALLOW REPEATED INSTRUCTION EXECUTION
.CONBT=12*1000		;SET THE CONTINUE FLOP (MOMENTARY). ALLOW THE
			;MICRO CODE TO LEAVE THE HALT LOOP
.IRLTC=14*1000		;UNLATCH THE IR AND LOAD IT FROM THE AD.
.DRLTC=15*1000		;UNLATCH THE DRAM REGISTER AND ALLOW IT TO LOAD FROM THE
			;RAMS
;
;	CLOCK LOAD FUNCTIONS
;
.LDBRR=42*1000	;LOA D THE RIGHT HAND 4 BITS OF THE 8 BIT
			;BURST COUNTER FROM EBUS BITS 32-35
.LDBRL=43*1000		;LOAD THE LEFT HAND 4 BITS OF THE BURST CTR.
.LDSEL=44*1000		;LOAD THE CLOCK SOURCE AND RATE SELECT
			;REGISTER: 32,33	34,35
			;	SOURCE		RATE
			;	 00 NORM XTL	00
			;	 01 FAST XTL	01 /2
			;	 10 EXT		10 /4
			;	 11 UNDEF	11 /8
.LDDIS=45*1000		;LOAD THE REGISTER WHICH CONTROLS THE EBOX CLOCK
			;DISTRIBUTION.
			;BIT	ACTION
			;33	DISABLE CONTROL LOGIC CLOCK
			;34	DISABLE CONTROL RAM CLOCK
			;35	DISABLE DATA PATHS CLOCK
.LDCK1=46*1000		;LOAD THE CONDITION-CHECKING ENABLE REGISTER.
			;THESE ALL ENABLE THE CLOCK TO STOP AND SHOULD
			;BE USED IN CONJUNCTION WITH BIT 35 OF FUNCTION 47
			;BIT	FUNCTION
			;32	CHECK FM PARITY
			;33	CHECK CRAM PARITY
			;34	CHECK DRAM PARITY
			;35	CHECK FIELD SERVICE PROBE
.LDCK2=47*1000		;LOAD THE ENABLE/DISABLE FUNCTION REGISTER
;			BIT	FUNCTION
			;32	DISABLE EBOX REQUESTS TO MBOX
			;33	SIMULATE AN MB RESP FOR EACH MB WAIT
			;34	CHECK AR AND ARX PARITY AND CAUSE A 
			;APGE FAIL UCODE TRAP IF ERROR
			;35	MUST BE SET TO PERFORM DESIRED ACTION OF
			;FUNCTION 46 (ABOVE).  STOPS ALL CLOCKS IF AN ERROR
			;IS DETECTED.
;
;	CONTROL RAM LOAD FUNCTIONS
.LCRM1=57*1000		;EBUS	CRAM
			;08-11	00-03
			;14-17	04-07
			;20-23	08-11
			;26-29	12-15
			;32-35	16-19
.LCRM2=56*1000		;08-11	20-23
			;14-17	24-27
			;20-23	28-31
			;26-29	32-35
			;32-35	36-39
.LCRM3=55*1000		;08-11	40-43
			;14-17	44-47
			;20-23	48-51
			;26-29	52-55
			;32-35	56-59
.LCRM4=54*1000		;08	60
			;10	62
			;14	64
			;16	66
			;20	68
			;22	70
			;26	72
			;28	74
			;32	76
			;34	78
.LCRM5=53*1000		;01-05	DISP 00-04
.LCRDL=52*1000		;01-05	CRAM DIAG ADDRES 00-04
.LCRDR=51*1000		;00-05	CRAM DIAG ADR 05-10
;
;	DRAM LOAD FUNCTIONS
;
.LDRM1=60*1000		;12-14	DRAM A00-02, EVEN ADDRESSES
			;15-17	DRAM B00-02, EVEN ADDRESSES
.LDRM2=61*1000		;12-14	DRAM A00-02, ODD ADDRESSES
			;15-17	DRAM B00-02, ODD ADDRESSES
.LDRM3=62*1000		;14-17	COMMON J01-04
.LDRJV=63*1000		;15-17	J08-10, EVEN ADDRESSES
			;12	PARIT BIT, EVEN ADDRESSES
.LDRJD=64*1000		;14	COMMON J07 (NOTE -- J05,6 DO NOT EXIST)
			;15-17	J08-10, ODD ADDRESSES
			;12	PARITY BIT, ODD ADDRESSES
;
;	IR, DRAM CONTROL FUNCTIONS
;
.DSIOJ=65*1000		;DISABLES SPECIAL DECODE OF OPCODES 254,7XX
.DSACF=66*1000		;DISABLE IR AC OUTPUTS
.EIOJA=67*1000		;ENABEL KL STYLE DECODING OF CODES AND AC'S
;
.INICL=70*1000	;INIT CHANNELS
;
.WRMBX=71*1000	;WRITE M-BOX
.MEMRS=76*1000	;SET KL10 MEM RESET FLOP
;
.RCRM1=147*1000	;READ C-RAM BITS 0-19
.RCRM2=146*1000	;READ C-RAM BITS 20-39
.RCRM3=145*1000	;READ C-RAM BITS 40-59
.RCRM4=144*1000	;READ C-RAM BITS 60-79
;
.RCSPF=141*1000	;READ SPEC FIELD OF C-RAM
;
.RDJ71=135*1000	;READ J07-J10 OF D-RAM
.RDJ14=134*1000	;READ J01-J04 OF D-RAM
.RDMAB=133*1000	;READ A & B FIELD OF D-RAM
;
.CSHRG=164*1000
.GFNR=102*1000
;
			;NOTE CONSOLE SOFTWARE MUST PERFORM THIS AS A PART OF
			;MASTER RESET CODE
;
;	LOAD AR FUNCTION
;
.LDAR=77*1000		;LOAD THE AR FROM EBUS 0-35
;
.PCAB1=150*1000		;PC-ADDRESS BREAK REGISTERS
.PCAB2=151*1000
.PCAB3=152*1000
.PCAB4=153*1000
;
;
;
;
;	DIAG3 DEFINITIONS
;
SWSLLT=100000	;SWAP SELECT LEFT
DPS4=040000	;PARITY
SCD=000040	;SHIFT CAPTURED DATA
DUPE= 000020	;DATO UNIBUS PARITY ERROR
CDD=000020	;CLEAR DUPE AND DURE ERROR FLAGS
WEP=000010	;WRITE EVEN (BAD) PARITY
DURE=000004	;DATO UNIBUS RECEIVE ERROR
NUPE=000002	;NPR UNIBUS PARITY ERROR
CNUPE=000002	;CLEAR NUPE
TO10BM=000001	;TO-10 BYTE TRANSFER MODE
;
;
;	DIAG2 DEFINITIONS
;
RFMAD0=100000	;RFM ADDRESS BIT 0
RFMAD1=040000	;RFM ADDRESS BIT 1
EDONES=040000	;EBUS DONE
RFMAD2=020000	;RFM ADDRESS BIT 2
RFMAD3=010000	;RFM ADDRESS BIT 3
DRESET=000100	;DTE RESET
;
;
;	STAT DEFINITIONS
;
TO10DN=100000	;TO-10 NORMAL TERMINATION
DON10S=100000	;NORMAL TERMINATION (DONE) TO 10
DON10C=040000	;TO-10 NORMAL TERMINATION STATUS
TO10ER=020000	;TO-10 ERROR TERMINATION
ERR10S=020000	;ERROR TERMINATION STATUS
RAMIS0=010000	;RAM IS ZEROS
ERR10C=010000	;CLEAR TO-10 ERROR TERMINATION
TO11DB=004000	;-10 REQUESTED -11 INTERRUPT
INT11S=004000	;REQ 11 STATUS
DXWRD1=002000	;DEXWORD 1
INT11C=002000	;-10 REQUESTS -11 INTERRUPT STATUS
MPE11=001000	;-11 MEMORY PARITY ERROR
PERCLR=001000	;CLEAR -11 MEMORY PARITY ERROR FLAG STATUS
TO10DB=000400	;-11 REQUEST -10 INTERRUPT
INT10S=000400	;REQUEST -10 INTERRUPT STATUS
TO11DN=000200	;TO-11 TRANSFER DONE
DON11S=000200	;TO-11 NORMAL TERMINATION FLAG STATUS
EBSEL=000100	;E BUFFER SELECT
DON11C=000100	;TO-11 NORMAL TERMINATION FLAG STATUS
NULSTP=000040	;NULL STOP
INTRON=000040	;11 INTERRUPT ENABLE
BPARER=000020	;EBUS PARITY ERROR 
EBUSPC=000020	;EBUS PARIT ERROR
RM=000010	;RESTRICTED MODE
INTROF=000010	;DISABLE PDP11 INTERRUPT
DEXDON=000004	;DEPOSIT/EXAMINE DONE
EBUSPS=000004	;EBUS PARITY ERROR SET
TO11ER=000002	;TO-11 BYTE ERROR TERMINATION
ERR11S=000002	;TO-11 ERROR TERMINATION FLAG STATUS
INTSON=000001	;INTERRUPTS ON
ERR11C=000001	;CLEAR TO-11 ERROR TERMINATION FLAG STATUS
;
;
;
;	DTE20 COMMUNICATION AREA OFFSETTS (WORD NAMES)
;
PIDENT=0	;PROCESSOR IDENTIFICATION WORD
CHNPNT=1	;POINTER TO COMM AREA OF NEXT PROCESSOR (CIRC LIST)
CYCLS=2		;CLOCK CPS COUNT
TOD=3		;TIME OF DAY
DATE=4		;DATE
PSWW1=5		;PROCESSOR STATUS WORD1
PSWW2=6		;PROCESSOR STATUS WORD2
PSWW3=7		;PROCESSOR STATUS WORD3
PSWW4=10	;PROCESSOR STATUS WORD4
PSWW5=11	;PROCESSOR STATUS WORD5
PSWW6=12	;PROCESSOR STATUS WORD6
PSWW7=13	;PROCESSOR STATUS WORD7
PSWW10=14	;PROCESSOR STATUS WORD10
PSWW11=15	;PROCESSOR STATUS WORD11
PSWW12=16	;PROCESSOR STATUS WORD12
PSWW13=17	;PROCESSOR STATUS WORD13
FORPRO=20	;FOR PROCESSOR IDENTIFICATON WORD
PROPNT=21	;POINTER TO COMM AREA OF THE PROCESSOR ASSOC WITH THIS BLOCK
STATUS=22	;COMMUNICATION STATUS WORD
QSIZE=23	;QUEUE SIZE WORD
;CTY0CW=24	;CTY #0 COMMAND WORD
;CTY0RW=25	;CTY #0 RESPONSE WORD
;CTY1CW=26	;CTY #1 COMMAND WORD
;CTY1RW=27	;CTY #1 RESPONSE WORD
;MISCW=30	;MISCELLANEOUS COMMAND WORD FOR NON-QUEUE PROTOCOL
;MISRW=31	;MISCELLANEOUS RESPONSE WORD
UNASG1=32	;UNASSIGNED WORD1
UNASG2=33	;UNASSIGNED WORD2
UNASG3=34	;UNASSIGNED WORD3
UNASG4=35	;UNASSIGNED WORD4
UNASG5=36	;UNASSIGNED WORD5
UNASG6=37	;UNASSIGNED WORD6
;
;	EPT ADDRESSES AS DEFINED IN BOOTS FOR USE IN THE
;	SECONDARY PROTOCOL
;
DTEFLG=444	;OPERATION COMPLETE FLAG
DTEF11=450	;PDP-10 FROM PDP-11 ARGUMENT
DTECMD=451	;PDP-10 TO PDP-11 COMMAND WORD
DTEMTD=455	;MONITOR TTY OUTPUT COMPLETE FLAG
DTEMTI=456	;MONITOR TTY INPUT FLAG
;
;
;	STATUS DEFINITONS
;
TOIT=1		;IN PROGRESS OF PROCESSING QUEUE
TOIP=2		;TO HIM INDIRECT IN PROGRESS
TOBM=4		;TO HIM WORD MODE REQUESTED
LOAD11=4	;LOAD ELEVEN
KLPWRF=10	; KL IS POWERFAILING
	.ENDM
;

	.LIST
;                             COPYRIGHT (C) 1975, 1978 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 THERE-
;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;       THE INFORMATION CONTAINED 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 SUPPILED BY DIGITAL.

	.LIST
;
;	CALL SUBROUTINE MACRO
;
	.MACRO	CALL	X,Y
	.NTYPE	$$,X
	.IF EQ	$$&70
	JSR	X,Y
	.IFF
	JSR	PC,X
	.ENDC
	.ENDM
	.MACRO	CALLR	A
	JMP	A
	.ENDM
	.MACRO	PRINT$
	.ENDM
;
;	RETURN  FROM SUBROUTINE MACRO
;
	.MACRO	RETURN	ARG
	.IF NB	<ARG>
	RTS	ARG
	.IFF
	RTS	PC
	.ENDC
	.ENDM
;
;	$CCR01 -- RETURN CC-C AND R0 +1
;
	.MACRO	$CCR01
	CLR	R0		;CLEARS CONDITION CODE C AND R0
	INC	R0		;INCREMENT R0 BUT DOES NOT ALTER CC-C
	.ENDM
;
;
;	$SCRM1 -- SET CONDITION CODE C AND R0 -1
;
	.MACRO	$SCRM1
	CLR	R0		;SET CC-C CLEAR AND CLEAR R0
	COM	R0		;MAKE R0 -1 AND SET CONDITION CODE C
	.ENDM
;
;
;	.INH -- INHIBIT INTERRUPTS MACRO
;
	.MACRO	.INH
	MOV	PS,-(SP)	;SAVE CURRENT PROCESSOR STATUS
	MOVB	#PR7,@#PS	;;;SET PRIORITY 7
	.ENDM
;
;	.ENB -- ENABLE INTERRUPTS MACRO
;
	.MACRO	.ENB
	MOV	(SP)+,@#PS	;;;RESTORE PROCESSOR STATUS
	.ENDM
;
;	.INH0 -- DISABLE TASK SWITCHING
;
	.MACRO	.INH0
	MOV	@#PS,-(SP)	;SAVE PREVIOUS STATUS
	MOVB	#140,@#PS	;RAISE PRIORITY TO 3
	.ENDM
;
;	.ENB0 -- ENABLE TASK SWITCHING
;
	.MACRO	.ENB0
	CALL	..ENB0
	.ENDM
;
;	.INH4 -- INHIBIT LEVEL 2
	.MACRO	.INH4
	MOV	@#PS,-(SP)
	MOVB	#200,@#PS
	.ENDM
;
;	.ENB4
;
	.MACRO	.ENB5
	MOV	(SP)+,@#PS
	.ENDM
;
;
;	.INH5 -- DISABLE LEVEL 5 INTERRUPTS
;
	.MACRO	.INH5
	MOV	@#PS,-(SP)	;SAVE PS
	MOVB	#240,@#PS
	.ENDM
;
;	.ENB5 -- ENABLE LEVEL 5 INTERRUPTS
;
	.MACRO	.ENB5
	MOV	(SP)+,@#PS
	.ENDM
;
;	.INH6 -- DISABLE LEVEL 6 INTERRUPTS
;
	.MACRO	.INH6
	MOV	@#PS,-(SP)
	MOVB	#300,@#PS
	.ENDM
;
;	.ENB6 -- ENABLE LEVEL 6 INTERRUPTS
;
	.MACRO	.ENB6
	MOV	(SP)+,@#PS
	.ENDM
;
;
;	DBL$S	CPUNUM
;
	.MACRO	DBL$S	CPUNUM,ERR
	MOV$	CPUNUM
	CLR	-(SP)
	CLR	-(SP)
	MOV	#DF.DOR,-(SP)	;RING DOORBELL FUNCTION
	MOV	#400*5.+DR.DTE,-(SP) ;DTE EMT (5 WORD DPB)
	DIR$	,ERR
	.ENDM
;
;	DBL$	CPUNUM
;
	.MACRO	DBL$	CPUNUM
	.WORD	400*5.+DR.DTE
	.WORD	DF.DOR
	.WORD	0,0
	.WORD	CPUNUM
	.ENDM	DBL$
;
;	DBL$C	CPUNUM
;
	.MACRO	DBL$C	CPUNUM,CS,ERR
	.MCALL	DBL$,DIR$
	.PSECT	$DPB$$
$$$=.
	DBL$	CPUNUM
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	DBL$C
;
;
;	DTON$S	ERR
;
	.MACRO	DTON$S	ERR
	.MCALL	DIR$
	MOV	#DF.ON,-(SP)	;SET DTEON FUNCTION
	MOV	#400*2.+DR.DTE,-(SP) ;DTE EMT (TWO WORD DPB)
	DIR$	,ERR
	.ENDM	DTON$S
;
;	DTON$
;
	.MACRO	DTON$
	.WORD	400*2.+DR.DTE
	.WORD	DF.ON
	.ENDM	DTON$
;
;	DTON$C
;
	.MACRO	DTON$C	CS,ERR
	.MCALL	DIR$
	.PSECT	$DPB$$
$$$=.
	DTON$
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	DTON$C
;
;
;	DTOF$S
;
	.MACRO	DTOF$S	ERR
	.MCALL	DIR$
	MOV	#DF.OFF,-(SP)	;DTE OFF FUNCTION
	MOV	#400*2.+DR.DTE,-(SP) ;DTE EMT (TWO WORD DPB)
	DIR$	,ERR
	.ENDM	DTOF$S
;
;	DTOF$
;
	.MACRO	DTOF$
	.WORD	400*2.+DR.DTE
	.WORD	DF.OFF
	.ENDM	DTOF$
;
;	DTOF$C	CS,ERR
;
	.MACRO	DTOF$C	CS,ERR
	.MCALL	DIR$,DTOF$
	.PSECT	$DPB$$
$$$=.
	DTOF$
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	DTOF$C
;
;	EMYG$S	WRDNUM,CORADR,ERR
;
	.MACRO	EMYG$S	WRDNUM,CORADR,ERR
	.MCALL	DIR$
	MOV$	CORADR
	MOV$	WRDNUM
	MOV	#DF.EMG,-(SP)	;EXAMINE MY GENERAL
	MOV	#400*4+DR.DTE,-(SP) ;DTE EMT (4 WORD DPB)
	DIR$	,ERR
	.ENDM	EMYG$S
;
;	EMYG$	WRDNUM,CORADR
;
	.MACRO	EMYG$	WRDNUM,CORADR
	.WORD	400*4.,DR.DTE
	.WORD	DF.EMG
	.WORD	WRDNUM
	.WORD	CORADR
	.ENDM	EMYG$
;
;	EMYG$C
;
	.MACRO	EMYG$C	WRDNUM,CORADR,CS,ERR
	.MCALL	DIR$,EMYG$
	.PSECT	$DPB$$
$$$=.
	EMYG$	WRDNUM,CORADR
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	EMYG$C
;
;	DMYG$S	WRDNUM,CORADR
;
	.MACRO	DMYG$S	WRDNUM,CORADR,ERR
	.MCALL	MOV$
	.MCALL	DIR$
	MOV$	CORADR
	MOV$	WRDNUM
	MOV	#DF.DMG,-(SP)
	MOV	#400*4+DR.DTE,-(SP) ;DTE FUNCTION (4 WORDS)
	DIR$	,ERR
	.ENDM	DMYG$S
;
;	DMYG$
;
	.MACRO	DMYG$	WRDNUM,CORADR
	.WORD	400*4.+DR.DTE
	.WORD	DF.DMG
	.WORD	WRDNUM
	.WORD	CORADR
	.ENDM	DMYG$
;
;	DMYG$C	WRDNUM,CORADR,CS,ERR
	.MACRO	DMYG$C	WRDNUM,CORADR,CS,ERR
	.MCALL	DIR$,DMYG$
$$$=.
	DMYG$	WRDNUM,CORADR
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	DMYG$C
;
;	EMYN$S	CPUNUM,WRDNUM,CORADR,ERR
;
	.MACRO	EMYN$S	CPUNUM,WRDNUM,CORADR,ERR
	.MCALL	MOV$
	MOV$	CPUNUM
	MOV$	CORADR
	MOV$	WRDNUM
	MOV	#DF.EMN,-(SP)
	MOV	#400*5.+DR.DTE,-(SP) ;DTE FUNCTION (5 WORDS)
	DIR$	,ERR
	.ENDM	EMYN$S
;
;
;	EMYN$	CPUNUM,WRDNUM,CORADR
;
	.MACRO	EMYN$	CPUNUM,WRDNUM,CORADR
	.WORD	400*5.+DR.DTE
	.WORD	DF.EMN
	.WORD	WRDNUM
	.WORD	CORADR
	.WORD	CPUNUM
	.ENDM	EMYN$
;
;	EMYN$C	CPUNUM,WRDNUM,CORADR,CS,ERR
;
	.MACRO	EMYN$C	CPUNUM,WRDNUM,CORADR,CS,ERR
	.MCALL	DIR$,EMYN$
	.PSECT	$DPB$$
$$$=.
	EMYN$	CPUNUM,WRDNUM,CORADR
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	EMYN$C
;
;
;	DMYN$S	CPUNUM,WRDNUM,CORADR,ERR
;
	.MACRO	DMYN$S	CPUNUM,WRDNUM,CORADR,ERR
	.MCALL	MOV$
	MOV$	CPUNUM
	MOV$	CORADR
	MOV$	WRDNUM
	MOV	#DF.DMN,-(SP)
	MOV	#400*5.+DR.DTE,-(SP) ;DTE FUNCION (5 WORDS)
	DIR$	,ERR
	.ENDM	DMYN$S
;
;	DMYN$	CPUNUM,WRDNUM,CORADR
;
	.MACRO	DMYN$	CPUNUM,WRDNUM,CORADR
	.WORD	400*5.+DR.DTE
	.WORD	DF.DMN
	.WORD	WRDNUM
	.WORD	XORADR
	.WORD	CPUNUM
	.ENDM	DMYN$
;
;	DMYN$C	CPUNUM,WRDNUM,CORADR,CS,ERR
;
	.MACRO	DMYN$C	CPUNUM,WRDNUM,CORADR,CS,ERR
	.MCALL	DIR$,DMYN$
	.PSECT	$DPB$$
$$$=.
	DMYN$
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	DMYN$C
;
;	EHSG$S	CPUNUM,WRDNUM,CORADR,ERR
;
	.MACRO	EHSG$S	CPUNUM,WRDNUM,CORADR,ERR
	.MCALL	MOV$
	MOV$	CPUNUM
	MOV$	CORADR
	MOV$	WRDNUM
	MOV	#DF.EHG,-(SP)
	MOV	#400*5.+DR.DTE,-(SP) ;DTE FUNCTION (5 WORDS)
	DIR$	,ERR
	.ENDM	EHSG$S
;
;	EHSG$	CPUNUM,WRDNUM,CORADR
;
	.MACRO	EHSG$	CPUNUM,WRDNUM,CORADR
	.WORD	400*5.+DR.DTE
	.WORD	DF.EHG
	.WORD	WRDNUM
	.WORD	CORADR
	.WORD	CPUNUM
	.ENDM	EHSG$
;
;	$EHSG$C	CPUNUM,WRDNUM,CORADR,CS,ERR
;
	.MACRO	EHSG$C	CPUNUM,WRDNUM,CORADR,CS,ERR
	.MCALL	DIR$,EHSG$
	.PSECT	$DPB$$
$$$=.
	EHSG$
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	EHSG$C
;
;
;	EHSM$S	CPUNUM,WRDNUM,CORADR,ERR
;
	.MACRO	EHSM$S	CPUNUM,WRDNUM,CORADR,ERR
	.MCALL	MOV$
	MOV$	CPUNUM
	MOV$	CORADR
	MOV$	WRDNUM
	MOV	#DF.EHM,-(SP)
	MOV	#400*5.+DR.DTE,-(SP) ;DTE FUNCTION (5 WORDS)
	DIR$	,ERR
	.ENDM	EHSM$S
;
;	EHSM$	CPUNUM,WRDNUM,CORADR
;
	.MACRO	EHSM$	CPUNUM,WRDNUM,CORADR
	.WORD	400*5.+DR.DTE
	.WORD	DF.EHM
	.WORD	WRDNUM
	.WORD	CORADR
	.WORD	CPUNUM
	.ENDM	EHSM$
;
;	EHSM$C	CPUNUM,WRDNUM,CORADR,CS,ERR
;
	.MACRO	EHSM$C	CPUNUM,WRDNUM,CORADR,CS,ERR
	.MCALL	DIR$,EHSM$
	.PSECT	$DPB$$
$$$=.
	EHSM$	CPUNUM,WRDNUM,CORADR
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	EHSM$C
;
;	KLDX$	FUNNM,EBSIN,DIAGRG,DTENUM,ERR
;
	.MACRO	KLDX$S	FUNNM,EBSIN,DIAGRG,DTENUM,ERR
	MOV$	DTENUM
	MOV$	DIAGRG
	MOV$	EBSIN
	MOV	#DF.KLX,-(SP)
	BIS	FUNNM,@SP
	MOV	#400*5.+DR.DTE,-(SP)
	DIR$	,ERR
	.ENDM	KLDX$S
;
;	KLDX$	FUNMN,EBSIN,DIAGRG,DTENUM
;
	.MACRO	KLDX$	FUN,EBSIN,DIAGRG,DTENUM
	.WORD	400*5.+DR.DTE
	.BYTE	DF.KLX,FUN/400
	.WORD	EBSIN
	.WORD	DIAGRG
	.WORD	DTENUM
	.ENDM	KLDX$
;
;
;	KLDX$C	FUNNM,EBSIN,DIAGRG,DTENUM,CS,ERR
;
	.MACRO	KLDX$C	FUNNM,EBSIN,DIAGRG,DTENUM,CS,ERR
	.MCALL	DIR$,KLDX$
	.PSECT	$DPB$$
$$$=.
	KLDX$	FUNNM,EBSIN,DIAGRG,DTENUM
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	KLDX$C
;
;	KLDW$	FUNNM,EBSIN,DIAGRG,DTENUM,ERR
;
	.MACRO	KLDR$S	FUNNM,EBSIN,DIAGRG,DTENUM,ERR
	MOV$	DTENUM
	MOV$	DIAGRG
	MOV$	EBSIN
	MOV	#DF.KLR,-(SP)
	BIS	FUNNM,@SP
	MOV	#400*5.+DR.DTE,-(SP)
	DIR$	,ERR
	.ENDM	KLDR$S
;
;	KLDR$	FUNMN,EBSIN,DIAGRG,DTENUM
;
	.MACRO	KLDR$	FUN,EBSIN,DIAGRG,DTENUM
	.WORD	400*5.+DR.DTE
	.BYTE	DF.KLR,FUN/400
	.WORD	EBSIN
	.WORD	DIAGRG
	.WORD	DTENUM
	.ENDM	KLDR$
;
;
;	KLDR$C	FUNNM,EBSIN,DIAGRG,DTENUM,CS,ERR
;
	.MACRO	KLDR$C	FUNNM,EBSIN,DIAGRG,DTENUM,CS,ERR
	.MCALL	DIR$,KLDR$
	.PSECT	$DPB$$
$$$=.
	KLDX$	FUNNM,EBSIN,DIAGRG,DTENUM
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	KLDR$C
;
;	KLDW$	FUNNM,EBSIN,DIAGRG,DTENUM,ERR
;
	.MACRO	KLDW$S	FUNNM,EBSIN,DIAGRG,DTENUM,ERR
	.WORD	DTENUM
	MOV$	DIAGRG
	MOV$	EBSIN
	MOV	#DF.KLW,-(SP)
	BIS	FUNNM,@SP
	MOV	#400*5.+DR.DTE,-(SP)
	DIR$	,ERR
	.ENDM	KLDW$S
;
;	KLDW$	FUNMN,EBSIN,DIAGRG,DTENUM
;
	.MACRO	KLDW$	FUN,EBSIN,DIAGRG,DTENUM
	.WORD	400*5.+DR.DTE
	.BYTE	DF.KLW,FUN/400
	.WORD	EBSIN
	.WORD	DIAGRG
	.WORD		DTENUM
	.ENDM	KLDW$
;
;
;	KLDW$C	FUNNM,EBSIN,DIAGRG,DTENUM,CS,ERR
;
	.MACRO	KLDW$C	FUNNM,EBSIN,DIAGRG,DTENUM,CS,ERR
	.MCALL	DIR$,KLDW$
	.PSECT	$DPB$$
$$$=.
	KLDW$	FUNNM,EBSIN,DIAGRG,DTENUM
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDM	KLDW$C
;
;	PREX$S -- PRIVILEDGED EXAMINE
;	PREX$S	DTENUM,PTR10,PTR11,TYPE
;
	.MACRO	PREX$S	DTENUM,PTR10,PTR11,TYPE,ERR
	MOV	DTENUM,-(SP)
	MOV	PTR11,-(SP)
	MOV	PTR10,-(SP)
	MOV	#DF.PEX,-(SP)
	MOVB	TYPE,1(SP)
	MOV	#400*5+DR.DTE,-(SP)
	DIR$	,ERR
	.ENDM	PREX$S
	.MACRO	PREX$	DTENUM,PTR10,PTR11,TYPE
	.BYTE	DR.DTE,5
	.BYTE	DF.PEX,TYPE
	.WORD	PTR10
	.WORD	PTR11
	.WORD	DTENUM
	.ENDM	PREX$
;
;
;	$PRVDP -- PRIVILEDGED DEPOSIT
;	PRDP$S	DTENUM,PTR10,PTR11,TYPE
;
	.MACRO	PRDP$S	DTENUM,PTR10,PTR11,TYPE,ERR
	MOV	DTENUM,-(SP)
	MOV	PTR11,-(SP)
	MOV	PTR10,-(SP)
	MOV	#DF.PDP,-(SP)
	MOVB	TYPE,1(SP)
	MOV	#400+5+DR.DTE,-(SP)
	DIR$	,ERR
	.ENDM
;
	.MACRO	PRDP$	DTENUM,PTR10,PTR11,TYPE
	.BYTE	DR.DTE,5
	.BYTE	DF.PDP,TYPE
	.WORD	PTR10
	.WORD	PTR11
	.WORD	DTENUM
	.ENDM	PRDP$
;
;
;	PUSH
;
	.MACRO	PUSH	LOCS
	.IRP	L,<LOCS>
	MOV	L,-(SP)
	.ENDM
	.ENDM
;
;	POP
;
	.MACRO	POP	LOCS
	.IRP	L,<LOCS>
	MOV	(SP)+,L
	.ENDM
	.ENDM
;
;	GODIG -- GO TO DIAGNOSTIC PACKAGE
;
;
	.LIST
;
;	.CRASH
;
	.MACRO	.CRASH	CODE
	IOT			;IOT CAUSES CRASH AND IS FOLLOWED BY CRASH CODE
CR$'CODE==.
	.ASCIZ	/CODE/
	.ENDM
;
;	IO10 I/O INSTRUCTION FOR PDP10 I/OINSTRUCTION
;
	.MACRO	$IO10	OP,DV,CI,AD,CXR
	.IIF	B,CI,I=0
	.IIF	NB,CI,I=CI
	.IIF	B,CXR,XR=0
	.IIF	NB,CXR,XR=CXR
	BLKO=2
	DATAO=3
	BLKI=0
	DATAI=1
	CONO=4
	CONI=5
	CONSZ=6
	CONSO=7
	APR=0
	PI=4
	PAG=10
	CCA=14
	ADH=0
	ADL=0
	.IRPC	AD1,AD
	.IIF	GE,<ADL-10000>,ADH=ADL/10000
	ADL=10*<ADL&7777>+AD1
	.ENDM
	.BYTE	<ADL&377>
	.BYTE	<<ADL/400>!<ADH*200&377>>
	.BYTE	<OP&1*200+<I*100+<XR*4>>+<ADH/2>>
	.BYTE	<DV&374+<OP/2>>
	.BYTE	<DV/400+16>
	.ENDM	$IO10
;
;	I10 PDP10 CPU INSTRUCTION MACRO
;
	.MACRO	$I10	OP,CAC,CI,CAD,CXR
	.IIF	B,CAD,AD=0
	.IF	NB,CAD
	ADH=0
	ADL=0
	.IRPC	AD1,CAD
	.IIF	GE,<ADL-10000>,ADH=ADL/10000
	ADL=10*<ADL&7777>+AD1
	.ENDM
	.ENDC
	.IIF	B,CAC,AC=0
	.IIF	NB,CAC,AC=CAC
	.IIF	B,CI,I=0
	.IIF	NB,CI,I=CI
	.IIF	B,CXR,XR=0
	.IIF	NB,CXR,XR=CXR
	.BYTE	<ADL&377>
	.BYTE	<<ADL/400>!<ADH*200&377>>
	.BYTE	<AC&1*200+<I*100+<XR*4>>+<ADH/2>>
	.BYTE	<OP&37*10+<AC/2>>
	.BYTE	<OP/40>
	.ENDM	$I10
;
;
	.MACRO	.STKM	RG0,RG1,RG2,RG3,RG4,RG5,RG6,UPC,UPS,SEP
	.BLKB	46
	.WORD	0,0,0,0		;SAVE AREA FOR $DSW
	.BLKB	16
	.WORD	UPS,UPC,SEP
	.BLKB	26
	.WORD	5
	.WORD	TTPEN
	.WORD	0
	.WORD	0
	.WORD	0
	.WORD	0
	.WORD	0
	.WORD	0
	.WORD	0
	.WORD	0
	.WORD	0
	.WORD	0
	.BLKW	40
SEP::
	.WORD	RG0
	.WORD	RG1
	.WORD	RG2
	.WORD	RG3
	.WORD	RG4
	.WORD	RG5
	.WORD	UPC
	.WORD	UPS
	.ENDM
;
;	.ATLEN -- ACTIVE TASK LIST ENTRY
;
	.MACRO	.ATLEN	FWD,BKWD,STK,PAR,PRI,SA,STAT,FB,STD,AEF1,AEF2,AFM1,AFM2,AFM3,AFM4,APF
;
	.WORD	FWD
	.WORD	BKWD
	.WORD	STK
	.WORD	PAR
	.WORD	PRI
	.WORD	SA
	.BYTE	STAT,FB
	.WORD	STD
	.WORD	AEF1,AEF2
	.WORD	AFM1,AFM2,AFM3,AFM4
	.WORD	APF
	.WORD	0
	.ENDM
;
;
;	.PUDEN -- PUD TABLE ENTRY
;
	.MACRO	.PUDEN	DEV,UNT,FB,UC1,UC2,UC3,UC4,RP,HA,CH,DACP,STD
	.ASCII	"DEV"
	.BYTE	UNT
	.BYTE	FB
	.WORD	UC1
	.WORD	UC2
	.WORD	UC3
	.WORD	UC4
	.WORD	0
	.WORD	RP
	.WORD	HA
	.WORD	.
	.WORD	.-2
	.WORD	0
	.BYTE	5,5
	.WORD	CH
	.WORD	-1
	.RAD50	/DACP/
	.WORD	STD
	.WORD	0
	.WORD	0
	.WORD	0
	.ENDM
;
;	.TPDEN -- TASK PARTITION ENTRY
	.MACRO	.TPDEN	NAM,BAD,SIZ,FW,HP
	.WORD	0,0
$$$=.
.=.-4
	.RAD50	"NAM"
.=$$$
	.WORD	BAD
	.WORD	SIZ
	.WORD	FW
	.WORD	HP
	.WORD	.
	.WORD	.-2
	.ENDM
;
;	SYSTEM TASK LIST ENTRY
;
	.MACRO	.STDEN	NAM,TPD,FW,DP,DI,BA,LZ,TZ,IPC,ISP,DAH,DAL
	.RAD50	"NAM"
	.WORD	TPD
	.WORD	FW
	.BYTE	DP,DI
	.WORD	BA
	.WORD	LZ
	.WORD	TZ
	.WORD	IPC
	.WORD	ISP
	.WORD	.
	.WORD	.-2
	.WORD	0
	.WORD	DAH
	.WORD	DAL
	.WORD	0
	.ENDM
;
;	DEVICE QUEUE POINTER ENTRY
;
	.MACRO	.DQPEN	TBLAD,TBLSZ,STDV,SPDV,ACK,ARG1,ARG2,ARG3
	.WORD	TBLAD
	.WORD	TBLSZ
	.WORD	STDV
	.WORD	SPDV
	.WORD	ACK
	.WORD	ARG1
	.WORD	ARG2
	.WORD	ARG3
	.ENDM
;
;	KT11 MACROS
;
;
;	MFPI -- MOVE FROM PREVIOUS
;
	.MACRO	MFPI	RG
	MOV	RG,-(SP)
	.ENDM
	.MACRO	SOB	REG,LBL
	DEC	REG
	BNE	LBL
	.ENDM
;
;	MTPI -- MOVE TO PREVIOUS
;
	.MACRO	MTPI	RG
	MOV	(SP)+,RG
	.ENDM
	.MACRO	MFPS	RG1,RG2
	MOV	RG1,RG2
	.ENDM
;
;
;	MTPS -- MOVE TO PREVIOUS SPACE
;
	.MACRO	MTPS	RG1,RG2
	MOV	RG1,RG2
	.ENDM
	.TITLE	FCSMAC-FILE CONTROL SERVICES MACRO DEFINITIONS
; ALTERED TUESDAY 20-AUG-74 10:35
	.IDENT	/0722/
;                             COPYRIGHT (C) 1972, 1978 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 THERE-
;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;       THE INFORMATION CONTAINED 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 SUPPILED BY DIGITAL.


; PETER H LIPMAN		5-DEC-72

; MCALL ALL THE FCS MACROS USED AT TOP LEVEL.
	.MACRO	FCSMC$
	.MCALL	OPEN$R,OPEN$W,OPEN$M,OPEN$U,OPEN$A,CLOSE$
	.MCALL	OPNS$R,OPNS$W,OPNS$M,OPNS$U,OPNS$A
	.MCALL	READ$,WRITE$,WAIT$,GET$,PUT$,DELET$,FINIT$
	.MCALL	FSRSZ$,FDBDF$,FDAT$A,FDRC$A,FDOP$A,FDBF$A,FDBK$A
	.MCALL	FDAT$R,FDRC$R,FDOP$R,FDBF$R,FDBK$R,NMBLK$
	.MACRO	FCSMC$
	.ENDM	FCSMC$
	.ENDM	FCSMC$
;

;  OPEN FILE FOR READING

	.MACRO	OPEN$R FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FO.RD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPEN$R

; OPEN FILE FOR WRITING
	.MACRO	OPEN$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPEN$W

; OPEN FILE FOR MODIFY
	.MACRO	OPEN$M FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FO.MFY,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPEN$M

; OPEN FILE FOR UPDATE
	.MACRO	OPEN$U FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FO.UPD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPEN$U

; OPEN FILE FOR APPEND
	.MACRO	OPEN$A FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FO.APD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPEN$A
;  OPEN FILE FOR READING - SHARED

	.MACRO	OPNS$R FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FA.SHR!FO.RD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPNS$R

; OPEN FILE FOR WRITING - SHARED
	.MACRO	OPNS$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FA.SHR!FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPNS$W

; OPEN FILE FOR MODIFY - SHARED
	.MACRO	OPNS$M FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FA.SHR!FO.MFY,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPNS$M

; OPEN FILE FOR UPDATE - SHARED
	.MACRO	OPNS$U FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FA.SHR!FO.UPD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPNS$U

; OPEN FILE FOR APPEND - SHARED
	.MACRO	OPNS$A FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FA.SHR!FO.APD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPNS$A

; OPEN A TEMP FILE AND MARK IT FOR DELETE
; CREATE, ACCESS, AND MARK FOR DELETE A NEW FILE
; NOT ENTERED IN A DIRECTORY
; WILL BE DELETED WHEN CLOSED (DEACCESSED)
; WILL EVEN BE PROPERLY DELETED IF PROGRAM SHOULD TERMINATE ABNORMALLY
	.MACRO	OPNT$D	FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPNT$W
	OPNT$W	FDB,LUN,FNPT,RACC,URBA,URBS
	BCS	.+6
	JSR	PC,.MRKDL
	ERR$	ERR
	.ENDM	OPNT$D
;
; OPEN A TEMP FILE
; CREATE AND ACCESS A NEW FILE, DON'T ENTER IT IN A DIRECTORY
; FILE MAY BE CLOSED AND REOPENED BY FILE ID
; FILE SHOULD BE DELETED BEFORE THE PROGRAM EXITS OTHERWISE IT
; WILL REMAIN IN THE INDEX FILE WITH NO DIRECTORY ENTRY 
	.MACRO	OPNT$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OPEN$
	OPEN$	FDB,#FA.TMP!FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OPNT$W

; OPEN FILE
	.MACRO	OPEN$ FDB,FACC,LUN,FNPT,DFNB,RACC,URBA,URBS,ERR
	.MCALL	FDOP$R,FDRC$R,ERR$,CMOV$B
	FDOP$R	FDB,LUN,FNPT,DFNB,FACC
	FDRC$R	,RACC,URBA,URBS
	.GLOBL	.OPEN
	JSR	PC,.OPEN
	ERR$	ERR
	.ENDM	OPEN$
; OPEN FILE FOR READING - BY FILE ID
	.MACRO	OFID$R FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OFID$
	OFID$	FDB,#FO.RD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OFID$R

; OPEN FILE FOR WRITING - BY FILE ID
	.MACRO	OFID$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OFID$
	OFID$	FDB,#FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OFID$W

; OPEN FILE FOR MODIFY - BY FILE ID
	.MACRO	OFID$M FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OFID$
	OFID$	FDB,#FO.MFY,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OFID$M

; OPEN FILE FOR UPDATE - BY FILE ID
	.MACRO	OFID$U FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OFID$
	OFID$	FDB,#FO.UPD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OFID$U

; OPEN FILE FOR APPEND - BY FILE ID
	.MACRO	OFID$A FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OFID$
	OFID$	FDB,#FO.APD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OFID$A

; OPEN FILE - BY FILE ID
	.MACRO	OFID$ FDB,FACC,LUN,FNPT,DFNB,RACC,URBA,URBS,ERR
	.MCALL	FDOP$R,FDRC$R,ERR$,CMOV$B
	FDOP$R	FDB,LUN,FNPT,DFNB,FACC
	FDRC$R	,RACC,URBA,URBS
	.GLOBL	.OPFID
	JSR	PC,.OPFID
	ERR$	ERR
	.ENDM	OFID$
; OPEN FILE FOR READING - BY FILE NAME BLOCK
	.MACRO	OFNB$R FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OFNB$
	OFNB$	FDB,#FO.RD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OFNB$R

; OPEN FILE FOR WRITING - BY FILE NAME BLOCK
	.MACRO	OFNB$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OFNB$
	OFNB$	FDB,#FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OFNB$W

; OPEN FILE FOR MODIFY - BY FILE NAME BLOCK
	.MACRO	OFNB$M FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OFNB$
	OFNB$	FDB,#FO.MFY,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OFNB$M

; OPEN FILE FOR UPDATE - BY FILE NAME BLOCK
	.MACRO	OFNB$U FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OFNB$
	OFNB$	FDB,#FO.UPD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OFNB$U

; OPEN FILE FOR APPEND - BY FILE NAME BLOCK
	.MACRO	OFNB$A FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	OFNB$
	OFNB$	FDB,#FO.APD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	OFNB$A

; OPEN FILE - BY FILE NAME BLOCK
	.MACRO	OFNB$ FDB,FACC,LUN,FNPT,DFNB,RACC,URBA,URBS,ERR
	.MCALL	FDOP$R,FDRC$R,ERR$,CMOV$B
	FDOP$R	FDB,LUN,FNPT,DFNB,FACC
	FDRC$R	,RACC,URBA,URBS
	.GLOBL	.OPFNB
	JSR	PC,.OPFNB
	ERR$	ERR
	.ENDM	OFNB$
; CLOSE THE FILE

	.MACRO	CLOSE$ FDB,ERR
	.MCALL	LDFDB$,ERR$
	LDFDB$	FDB
	.GLOBL	.CLOSE
	JSR	PC,.CLOSE
	ERR$	ERR
	.ENDM	CLOSE$

; READ A VIRTUAL BLOCK

	.MACRO	READ$ FDB,BKAD,BKSZ,BKVB,BKEF,BKST,BKDN,ERR
	.MCALL	FDBK$R,ERR$
	FDBK$R	FDB,BKAD,BKSZ,BKVB,BKEF,BKST,BKDN
	.GLOBL	.READ
	JSR	PC,.READ
	ERR$	ERR
	.ENDM	READ$
; WRITE VIRTUAL BLOCK

	.MACRO	WRITE$ FDB,BKAD,BKSZ,BKVB,BKEF,BKST,BKDN,ERR
	.MCALL	FDBK$R,ERR$
	FDBK$R	FDB,BKAD,BKSZ,BKVB,BKEF,BKST,BKDN
	.GLOBL	.WRITE
	JSR	PC,.WRITE
	ERR$	ERR
	.ENDM	WRITE$
;
; WAIT FOR I/O COMPLETION AFTER READ$ OR WRITE$
;
	.MACRO	WAIT$	FDB,EFN,BKST,ERR
	.MCALL	LDFDB$,CMOV$W,CMOV$B,ERR$
	LDFDB$	FDB
	CMOV$B	EFN,F.EFN
	CMOV$W	BKST,F.BKST
	.GLOBL	.WAIT
	JSR	PC,.WAIT
	ERR$	ERR
	.ENDM	WAIT$
; GET A RECORD

	.MACRO	GET$ FDB,INADR,MAXCNT,ERR
	.MCALL	LDFDB$,CMOV$W,ERR$
	LDFDB$	FDB
	CMOV$W	INADR,F.URBD+2	;USER RECORD BUFFER ADDRESS
	CMOV$W	MAXCNT,F.URBD	;USER RECORD BUFFER SIZE
	.GLOBL	.GET
	JSR	PC,.GET
	ERR$	ERR
	.ENDM	GET$
; GET A RECORD - IN RANDOM MODE

	.MACRO	GET$R FDB,INADR,MAXCNT,LRCNM,HRCNM,ERR
	.MCALL	LDFDB$,CMOV$W,ERR$
	LDFDB$	FDB
	CMOV$W	INADR,F.URBD+2	;USER RECORD BUFFER ADDRESS
	CMOV$W	MAXCNT,F.URBD	;USER RECORD BUFFER SIZE
	CMOV$W	LRCNM,F.RCNM+2	;LOW ORDER RECORD NUMBER
	CMOV$W	HRCNM,F.RCNM	;HIGH ORDER RECORD NUMBER
	.GLOBL	.GET
	JSR	PC,.GET
	ERR$	ERR
	.ENDM	GET$R
; GET A RECORD  - SEQUENTIAL MODE STRICTLY

	.MACRO	GET$S FDB,INADR,MAXCNT,ERR
	.MCALL	LDFDB$,CMOV$W,ERR$
	LDFDB$	FDB
	CMOV$W	INADR,F.URBD+2	;USER RECORD BUFFER ADDRESS
	CMOV$W	MAXCNT,F.URBD	;USER RECORD BUFFER SIZE
	.GLOBL	.GETSQ
	JSR	PC,.GETSQ
	ERR$	ERR
	.ENDM	GET$S
; PUT A RECORD - RANDOM OR SEQUENTIAL

	.MACRO	PUT$ FDB,OUTADR,OUTCNT,ERR
	.MCALL	LDFDB$,CMOV$W,ERR$
	LDFDB$	FDB
	CMOV$W	OUTADR,F.NRBD+2	;NEXT RECORD BUFFER ADDRESS
	CMOV$W	OUTCNT,F.NRBD	;NEXT RECORD BUFFER SIZE
	.GLOBL	.PUT
	JSR	PC,.PUT
	ERR$	ERR
	.ENDM	PUT$

; PUT A RECORD - RANDOM MODE

	.MACRO	PUT$R FDB,OUTADR,OUTCNT,LRCNM,HRCNM,ERR
	.MCALL	LDFDB$,CMOV$W,ERR$
	LDFDB$	FDB
	CMOV$W	OUTADR,F.NRBD+2	;NEXT RECORD BUFFER ADDRESS
	CMOV$W	OUTCNT,F.NRBD	;NEXT RECORD BUFFER SIZE
	CMOV$W	LRCNM,F.RCNM+2	;LOW ORDER RECORD NUMBER
	CMOV$W	HRCNM,F.RCNM	;HIGH ORDER RECORD NUMBER
	.GLOBL	.PUT
	JSR	PC,.PUT
	ERR$	ERR
	.ENDM	PUT$R

; PUT A RECORD - SEQUENTIAL MODE STRICTLY

	.MACRO	PUT$S FDB,OUTADR,OUTCNT,ERR
	.MCALL	LDFDB$,CMOV$W,ERR$
	LDFDB$	FDB
	CMOV$W	OUTADR,F.NRBD+2	;NEXT RECORD BUFFER ADDRESS
	CMOV$W	OUTCNT,F.NRBD	;NEXT RECORD BUFFER SIZE
	.GLOBL	.PUTSQ
	JSR	PC,.PUTSQ
	ERR$	ERR
	.ENDM	PUT$S
; DELETE A FILE
	.MACRO	DELET$	FDB,ERR
	.MCALL	LDFDB$,ERR$
	LDFDB$	FDB
	.GLOBL	.DELET
	JSR	PC,.DELET
	ERR$	ERR
	.ENDM	DELET$

; INITIALIZE THE FILE CONTROL SERVICES
	.MACRO	FINIT$
	.GLOBL	.FINIT
	JSR	PC,.FINIT
	.ENDM	FINIT$

;
;
	.MACRO	FSRSZ$ NFILES,BFSPAC,PSECT
	.MCALL	BDOFF$,DEF$L
	.IF	NDF,S.BFHD
	BDOFF$	DEF$N
	DEF$L	S.BFHD
	.ENDC
	.GLOBL	.FSRCB
	.PSECT	$$FSR1,GBL,OVR,D
	.IF	NB,<BFSPAC>
	.BLKB	NFILES*S.BFHD+<BFSPAC>
	.IFF
	.BLKB	NFILES*<S.BFHD+512.>
	.ENDC

	.PSECT	PSECT
	.ENDM	FSRSZ$

; FILE DESCRIPTOR BLOCK - ALLOCATION OF SPACE AT ASSEMBLY TIME

	.MACRO	FDBDF$
	.MCALL	FDBSZ$
	FDBSZ$
	...PC1=.
	.BLKB	S.FDB
	.ENDM	FDBDF$
; FILE ATTRIBUTE SECTION OF FDB-ASSEMBLY TIME INITIALIATION

	.MACRO	FDAT$A RTYP,RATT,RSIZ,CNTG,ALOC
	.MCALL	FDOFF$,CBYTE$,CWORD$
	FDOFF$	DEF$L
	CBYTE$	<RTYP>,F.RTYP
	CBYTE$	<RATT>,F.RATT
	CWORD$	<RSIZ>,F.RSIZ
	CWORD$	<CNTG>,F.CNTG
	CWORD$	<ALOC>,F.ALOC
	.ENDM	FDAT$A

; RECORD ACCESS SECTION OF FDB-ASSEMBLY TIME INITIALIZATION

	.MACRO	FDRC$A RACC,URBA,URBS
	.MCALL	FDOFF$,CBYTE$,CWORD$
	FDOFF$	DEF$L
	CBYTE$	<RACC>,F.RACC
	CWORD$	<URBA>,F.URBD+2
	CWORD$	<URBS>,F.URBD
	.ENDM	FDRC$A

; FILE OPEN SECTION OF FDB-ASSEMBLY TIME INITIALIZATION
	.MACRO	FDOP$A LUN,FNPT,DFNB,FACC
	.MCALL	FDOFF$,CBYTE$,CWORD$
	FDOFF$	DEF$L
	CBYTE$	<LUN>,F.LUN
	CWORD$	<FNPT>,F.DSPT
	CWORD$	<DFNB>,F.DFNB
	CBYTE$	<FACC>,F.FACC
	.ENDM	FDOP$A

; BUFFER DECRIPTOR SECTION OF FDB-ASSEMBLY TIME INITIALIZATION

	.MACRO	FDBF$A EFN,OVBS,MBCT,MBFG
	.MCALL	FDOFF$,CBYTE$,CWORD$
	FDOFF$	DEF$L
	CBYTE$	<EFN>,F.EFN
	CWORD$	<OVBS>,F.OVBS
	CBYTE$	<MBCT>,F.MBCT
	CBYTE$	<MBFG>,F.MBFG
	.ENDM	FDBF$A

; BLOCK ACCESS SECTION OF FDB ASSEMBLY TIME INITIALIZATION
	.MACRO	FDBK$A BKAD,BKSZ,BKVB,BKEF,BKST,BKDN
	.MCALL	FDOFF$,CBYTE$,CWORD$
	FDOFF$	DEF$L
	CWORD$	<BKAD>,F.BKDS+2
	CWORD$	<BKSZ>,F.BKDS
	CWORD$	<BKVB>,F.BKVB+2	;STORE LOW ORDER ONLY
	CBYTE$	<BKEF>,F.BKEF
	CWORD$	<BKST>,F.BKST
	CWORD$	<BKDN>,F.BKDN
	.ENDM	FDBK$A
; FILE ATTRIBUTE SECTION OF FDB-RUNTIME INITIALIZATION

	.MACRO	FDAT$R FDB,RTYP,RATT,RSIZ,CNTG,ALOC
	.MCALL	LDFDB$,CMOV$W,CMOV$B

	LDFDB$	FDB		;SAVE R0 AND LOAD FDB
	CMOV$B	RTYP,F.RTYP
	CMOV$B	RATT,F.RATT
	CMOV$W	RSIZ,F.RSIZ
	CMOV$W	CNTG,F.CNTG
	CMOV$W	ALOC,F.ALOC
	.ENDM	FDAT$R

; RECORD ACCESS SECTION OF FDB-RUNTIME INITIALIZATION

	.MACRO	FDRC$R FDB,RACC,URBA,URBS
	.MCALL	LDFDB$,CMOV$W,CMOV$B
	LDFDB$	FDB
	CMOV$B	RACC,F.RACC
	CMOV$W	URBA,F.URBD+2
	CMOV$W	URBS,F.URBD
	.ENDM	FDRC$R

; FILE OPEN SECTION OF FDB-RUNTIME INITIALIZATION

	.MACRO	FDOP$R FDB,LUN,FNPT,DFNB,FACC
	.MCALL	LDFDB$,CMOV$W,CMOV$B
	LDFDB$	FDB
	CMOV$B	LUN,F.LUN
	CMOV$W	FNPT,F.DSPT
	CMOV$W	DFNB,F.DFNB
	CMOV$B	FACC,F.FACC
	.ENDM	FDOP$R

; BLOCK BUFFER SECTION OF FDB-RUNTIME INITIALIZATION.

	.MACRO	FDBF$R FDB,EFN,OVBS,MBCT,MBFG
	.MCALL	LDFDB$,CMOV$W,CMOV$B
	LDFDB$	FDB
	CMOV$B	EFN,F.EFN	;EVENT FLAG TO USE
	CMOV$W	OVBS,F.OVBS	;SIZE OF BLOCK BUFFER
	CMOV$B	MBCT,F.MBCT	;NO. OF BUFFERS
	CMOV$B	MBFG,F.MBFG	;READ AHEAD OR WRITE BEHIND
	.ENDM	FDBF$R

; BLOCK ACCESS SECTION OF FDB-RUNTIME INITIALIZATION

	.MACRO	FDBK$R FDB,BKAD,BKSZ,BKVB,BKEF,BKST,BKDN
	.MCALL	LDFDB$,CMOV$B,CMOV$W,CMOV$2
	LDFDB$	FDB
	CMOV$W	BKAD,F.BKDS+2	;BLOCK ADDRESS-MEMORY BUFFER
	CMOV$W	BKSZ,F.BKDS	;SIZE OF TRANSFER IN BYTES
	CMOV$2	BKVB,F.BKVB	;ADDRESS OF 2 WORD VIRTUAL
				;BLOCK NUMBER, MOVE BOTH WORDS
	CMOV$B	BKEF,F.BKEF	;EVENT FLAG
	CMOV$W	BKST,F.BKST	;ADR OF I/O STATUS BLOCK
	CMOV$W	BKDN,F.BKDN	;ADR OF I/O DONE AST
	.ENDM	FDBK$R
; DEFINE THE SIZE OF THE FDB AS A LOCAL SYMBOL (S.FDB)
	.MACRO	FDBSZ$		;DEFINE S.FDB AS SIZE OF FDB
	.IIF	DF,S.FDB,.MEXIT
	.MCALL	FDOFF$,DEF$L
	FDOFF$	DEF$N		;INVOKE OFFSET DEFINITIONS BUT DON'T
				;ACTUALLY DEFINE THE OFFSET NAMES
	DEF$L	S.FDB		;NOW DEFINE S.FDB
	.ENDM	FDBSZ$

; INVOKE FDOFF$ TO DEFINE OFFSETS AS LOCAL - DO IT ONCE ONLY
	.MACRO	FDOF$L
	.MCALL	FDOFF$
	FDOFF$	DEF$L
	.ENDM	FDOF$L
;
; DEFINE FILE NAME BLOCK AT ASEMBLY TIME
	.MACRO	NMBLK$	FNAME,FTYPE,VERS,DEVNAM,UNIT
	.MCALL	RAD50$,CWORD$,NBOFF$
	NBOFF$	DEF$L		;DEFINE NAME BLOCK OFFSETS LOCALLY
	.IIF	NDF,...PC1,...PC1=0
	...PC3=...PC1		;PRESERVE ...PC1
	...PC1=.
	.=...PC1+N.FNAM
	RAD50$	<FNAME>,S.FNAM/2
	.=...PC1+N.FTYP
	RAD50$	<FTYPE>,S.FTYP/2
	CWORD$	<VERS>,N.FVER
	.IF	NB,DEVNAM
	.=...PC1+N.DVNM
	.WORD	"DEVNAM
	.ENDC
	CWORD$	<UNIT>,N.UNIT
	.=...PC1+S.FNB
	...PC1=...PC3		;RESTORE ...PC1
	.ENDM	NMBLK$
;
; INVOKE NBOFF$ TO DEFINE OFFSETS AS LOCAL - DO IT ONCE ONLY
	.MACRO	NBOF$L
	.MCALL	NBOFF$
	NBOFF$	DEF$L
	.ENDM	NBOF$L


; IF THE FDB PARAM IS NULL OR R0, THEN DON'T
; GENERATE A MOVE OF FDB TO R0.  OTHERWISE
; GENERATE THE MOVE

	.MACRO	LDFDB$ FDB
	.IIF	B,FDB,.MEXIT	;IF NULL THEN EXIT
	.NTYPE	PAR$$$,FDB
	.IIF	EQ,PAR$$$,.MEXIT ;IF R0 THEN EXIT
	MOV	FDB,R0		;ELSE GENERATE THE MOVE
	.ENDM	LDFDB$
; CONDITIONALLY MOVE A WORD TO THE SPECIFIED OFFSET OF R0

	.MACRO	CMOV$W VAR,OFFSET
	.IF	IDN,<#0>,<VAR>
	CLR	OFFSET(R0)
	.MEXIT
	.ENDC
	.IIF	NB,VAR,	MOV	VAR,OFFSET(R0)
	.ENDM	CMOV$W

; CONDITIONALLY GENERATE A MOVE BYTE TO THE SPECIFIED OFFSET OF R0

	.MACRO	CMOV$B VAR,OFFSET
	.IF	IDN,<#0>,<VAR>
	CLRB	OFFSET(R0)
	.MEXIT
	.ENDC
	.IIF	NB,VAR,	MOVB VAR,OFFSET(R0)
	.ENDM	CMOV$B

; CONDITIONALLY MOVE 2 WORDS FROM VAR TO THE SPECIFIED OFFSET OF R0
	.MACRO	CMOV$2 VAR,OFFSET
	.IIF	B,VAR,.MEXIT
	MOV	VAR,-(SP)	;ADDRESS OF 2 WORDS TO STATE
	MOV	@(SP),OFFSET(R0) ;FIRST WORD TO FDB
	ADD	#2,(SP)		;CALCULATE ADR OF 2ND WORD
	MOV	@(SP)+,OFFSET+2(R0) ;2ND WORD TO FDB
	.ENDM	CMOV$2

; CONDITIONALLY ASSEMBLE .BYTE DIRECTIVE FOR VAR
; AT THE SPECIFIED OFFSET FROM THE BEGINNING OF THE FDB

	.MACRO	CBYTE$ VAR,OFFSET
	.IF	NB,VAR		;IF NON NULL
	...PC2=.		;SAVE PC
	.=...PC1+OFFSET		;SET PC TO SPECIFIED OFFSET
	.BYTE	VAR		;ASSEMBLE THE BYTE
	.=...PC2		;RESTORE PC
	.ENDC
	.ENDM	CBYTE$


; CONDITIONALLY ASSEMBLE WORD DIRECTIVE FOR VAR
; AT THE SPECIFIED OFFSET FROM THE BEGINNING OF THE FDB

	.MACRO	CWORD$ VAR,OFFSET
	.IF NB,VAR		;IF VAR IS NOT NULL
	...PC2=.		;SAVE THE PC
	.=...PC1+OFFSET		;SET THE PC TO THE SPECIFIED OFFSET
	.WORD	VAR		;ASSEMBLE THE WORD
	.=...PC2		;RESTORE THE PC
	.ENDC
	.ENDM	CWORD$
; DEFINE FCS BITS AND VALUES LOCALLY OR GLOBALLY
; CALL WITH DEF$G FOR GLOBAL DEFINITIONS, CONVENTIONALLY
; CALLED WITH DEF$L FOR LOCAL, BUT ANYTHING NOT EQUAL TO DEF$G
; WILL DO
	.MACRO	FCSBT$	GLOBL
	.MCALL	DEFIN$
	...GBL=0
	.IIF	IDN,<GLOBL>,<DEF$G>,...GBL=1
;
;
; F.RATT BITS - RECORD ATTRIBUTE BYTE
	DEFIN$	FD.FTN,1	;FORTRAN CARRIAGE CONTROL BIT
	DEFIN$	FD.CR,2		;INSERT CARRIAGE RETURNS BETWEEN RECORDS
	DEFIN$	FD.BLK,10	;1 IF RECORDS CANNOT CROSS BLOCK BOUNDARIES
; F.RACC BITS - RECORD ACCESS BYTE
	DEFIN$	FD.RWM,1	;ON IF READ/WRITE,OFF IF GET/PUT
	DEFIN$	FD.RAN,2	;ON IF RANDOM,OFF IF SEQUENTIAL
	DEFIN$	FD.PLC,4	;ON IF PARTIAL LOCATE,OFF IF SEQUENTIAL
	DEFIN$	FD.INS,10	;ON IF PUT SEQUENTIAL INSERT MODE
				;OFF IF TRUNCATE MODE
; F.RCTL BITS - RECORD CONTROL BYTE - DEVICE CHARACTERISTICS
	DEFIN$	FD.REC,1	;ON IF RECORD ORIENTED DEV, OFF IF BLK ORIENTED
	DEFIN$	FD.CCL,2	;ON IF CARRIAGE CONTROL OUTPUT DEVICE
				;OFF IF NOT
	DEFIN$	FD.TTY,4	;ON IF THIS DEVICE IS A TTY
	DEFIN$	FD.DIR,10	;ON IF DIRECTORY DEVICE, OFF IF NOT
	DEFIN$	FD.SDI,20	;ON IF SINGLE DIRECTORY DEVICE
	DEFIN$	FD.SQD,40	;ON IF SEQUENTIAL DEVICE
;
; N.STAT BITS - FILE NAME BLOCK STATUS WORD - SET BY PARSE
	DEFIN$	NB.VER,1	;SET IF FILE VERSION WAS EXPLICIT
	DEFIN$	NB.TYP,2	;SET IF FILE TYPE WAS EXPLICIT
	DEFIN$	NB.NAM,4	;SET IF FILE NAME WAS EXPLICIT
	DEFIN$	NB.SVR,10	;SET IF * IN VERSION FIELD
	DEFIN$	NB.STP,20	;SET IF * IN TYPE FIELD
	DEFIN$	NB.SNM,40	;SET IF * IN NAME FILED
	DEFIN$	NB.DIR,100	;SET IF EXPLICIT DIRECTORY SPECIFIED
	DEFIN$	NB.DEV,200	;SET IF DEVICE NAME WAS EXPLICIT
	DEFIN$	NB.SD1,400	;SET IF * IN PROJECT NUMBER OF PPN
	DEFIN$	NB.SD2,1000	;SET IF * IN PROGRAMMER NUMBER OF PPN
; ***** BEWARE MORE BITS IN N.STAT USED BY FCS LOCALLY
; CHECK DEFINITION SECTION IN FCS
;
; F.RTYP VALUES - RECORD TYPE BYTE - ***** NOTE THESE ARE VALUES, NOT BITS
	DEFIN$	R.FIX,1		;FIXED LENGTH RECORDS
	DEFIN$	R.VAR,2		;VARIABLE LENGTH RECORDS
;
; F.FACC BITS - FILE ACCESS BYTE
	DEFIN$	FA.RD,1		;SET IF READ ONLY
	DEFIN$	FA.WRT,2	;SET IF ACCESSED FOR WRITE
	DEFIN$	FA.EXT,4	;SET IF ACCESS FOR EXTEND
	DEFIN$	FA.CRE,10	;SET IF CREATING NEW FILE
	DEFIN$	FA.TMP,20	;SET IF CREATING TEMP FILE
	DEFIN$	FA.SHR,40	;SET IF SHARED ACCESS
;
; THE FOLLOWING TWO NAMES APPLY TO THE SAME CONTROL BIT IN F.FACC
; FA.APD IS ONLY USED IF THE FILE IS AN EXISTING FILE (FA.CRE=0)
; FA.NSP IS ONLY USED IF THE FILE IS BEING CREATED (FA.CRE=1)
;
	DEFIN$	FA.APD,100	;SET IF APPENDING (POSIT TO EOF)
	DEFIN$	FA.NSP,100	;SET IF INHIBITING SUPERSEDE ON FILE CREATION
; 
	DEFIN$	FO.RD,FA.RD	;OPEN FOR READ
	DEFIN$	FO.WRT,FA.WRT!FA.EXT!FA.CRE ;OPEN FOR WRITE (CREATE)
	DEFIN$	FO.APD,FA.WRT!FA.EXT!FA.APD ;OPEN FOR APPEND
	DEFIN$	FO.MFY,FA.WRT	;OPEN FOR MODIFY
	DEFIN$	FO.UPD,FA.WRT!FA.EXT ;OPEN FOR UPDATE
;
; F.MBFG BITS - MULTIPLE BUFFERING FLAG WORD - USER CONTROLLED AND SET BY OPEN
	DEFIN$	FD.RAH,1	;READ AHEAD IF SET - THIS OR WRITE BEHIND
	DEFIN$	FD.WBH,2	;WRITE BEHIND IF SET - NOT BOTH
; ***** BEWARE MORE BITS IN F.MBFG USED IN FCS LOCALLY
;
;
	.MACRO	FCSBT$	ARG
	.ENDM	FCSBT$
	.ENDM	FCSBT$
;
; EQUATE THE SYMBOL WITH ITS SPECIFIED VALUE
; DEFINE IT GLOBALLY IF ...GBL=1, OTHERWISE LOCALLY
	.MACRO	DEFIN$	SYM,VAL
	.IIF	EQ,...GBL-1,.GLOBL SYM
	SYM=VAL
	.ENDM	DEFIN$
; FILE DESCRIPTOR BLOCK OFFSETS DEFINITION MACRO
; CALL WITH ONE OF THE FOLLOWING MACRO NAMES DEF$L,DEF$G,DEF$N
; TO DEFINE LOCAL OFFSETS, DEFINE TOTAL OFFSETS,
; OR DEFINE NO OFFSETS.  THE LATTER SETS THINGS UP
; SO THAT ONLY THE SIZE OF THE FDB CAN BE
; DEFINED

	.MACRO	FDOFF$ OFFSET
	.MCALL	OFFSET,DEF$I,NBOFF$
	NBOFF$	OFFSET
	DEF$I	0		;INIT THE DEFINITION MACRO
; FILE ATTRIBUTE SECTION
	OFFSET	F.RTYP,1	;RECORD TYPE
	OFFSET	F.RATT,1	;RECORD ATTRIBUTES
	OFFSET	F.RSIZ,2	;RECORD SIZE
	OFFSET	F.HIBK,4	;HIGHEST VIRTUAL BLOCK NO. ALLOCATED
	OFFSET	F.EFBK,4	;END OF FILE BLOCK NUMBER
	OFFSET	F.FFBY,2	;FIRST FREE BYTE IN LAST BLOCK
	OFFSET	S.FATT		;SIZE OF FILE ATTRIBUTE SECTION

; RECORD ACCESS SECTION

	OFFSET	F.RACC,1	;RECORD ACCESS
	OFFSET	F.RCTL,1	;RECORD CONTROL
	OFFSET	F.BKDS		;BLOCK I/O - BUFFER DESCRIPTOR
	OFFSET	F.URBD,4	;USER'S RECORD BUFFER DESCRIPTOR
	OFFSET	F.BKST		;BLOCK I/O - I/O STATUS BLOCK ADDRESS
	OFFSET	F.NRBD,2	;NEXT RECORD BUFFER DESCRIPTOR
	OFFSET	F.BKDN		;BLOCK I/O - I/O DONE AST ADDRESS
	OFFSET	,2		;2ND WORD OF NRBD
	OFFSET	F.OVBS		;OVERRIDE BLOCK BUFFER SIZE
	OFFSET	F.NREC,2	;NEXT RECORD ADDRESS IN BLOCK BUFFER
	OFFSET	F.EOBB,2	;END OF BLOCK BUFFER
	OFFSET	F.CNTG		;SIZE IN BLOCKS OF CONTIGUOUS FILE
	OFFSET	F.RCNM,2	;RECORD NUMBER FOR RANDOM RECORDS
	OFFSET	F.STBK		;ADDRESS TO READ IN STATISTICS BLOCK
	OFFSET	,2		;2ND WORD OF RCNM
	OFFSET	F.ALOC,2	;ALLOCATE THIS MUCH SPACE WHEN NEED
				;TO EXTEND, + = CONTIG, - = NOT

; FILE OPEN SECTION
	OFFSET	F.LUN,1		;LOGICAL UNIT NUMBER
	OFFSET	F.FACC,1	;FILE ACCESS
	OFFSET	F.DSPT,2	;FILE DESCRIPTOR POINTER
	OFFSET	F.DFNB,2	;DEFAULT FILE NAME BLOCK ADDRESS

; BLOCK BUFFER SECTION
	OFFSET	F.BKEF		;BLOCK I/O - EVENT FLAG NUMBER
	OFFSET	F.EFN,1		;EVENT FLAG USED IN QIO
	OFFSET	F.BKP1,1	;BOOKKEEPING BITS
	OFFSET	F.ERR,2		;1ST BYTE ERROR RETURN CODE
				;2ND BYTE FOR QI/O ERROR INDICATOR
	OFFSET	F.MBCT,1	;NUMBER OF BUFFERS TO USE (DESIRED)
	OFFSET	F.MBC1,1	;NO. OF BUFFERS IN USE
	OFFSET	F.MBFG,1	;MULTIPLE BUFFERING CONTROL FLAGS
	OFFSET	F.BGBC,1	;BIG BUFFER BLOCK COUNT (SIZE IN BLOCKS)
	OFFSET	F.VBSZ,2	;VIRTUAL BLOCK SIZE IN BYTES
	OFFSET	F.BBFS,2	;BLOCK BUFFER SIZE
	OFFSET	F.BKVB		;BLOCK I/O - VIRTUAL BLOCK NUMBER
	OFFSET	F.VBN,4		;VIRTUAL BLOCK NUMBER
	OFFSET	F.BDB,2		;BLOCK BUFFER DESCRIPTOR BLOCK
	OFFSET	,8.		;SPARE

; FILE NAME BLOCK SECTION
	OFFSET	F.FNB,S.FNB	;BEGINNING OF FILE NAME BLOCK
	.IIF	IDN,<OFFSET>,<DEF$N>,.MEXIT
	.IF	IDN,<OFFSET>,<DEF$G>
	.GLOBL	F.FNAM,F.FTYP,F.FVER,F.DVNM,F.UNIT
	.ENDC
	F.FNAM=N.FNAM+F.FNB
	F.FTYP=N.FTYP+F.FNB
	F.FVER=N.FVER+F.FNB
	F.DVNM=N.DVNM+F.FNB
	F.UNIT=N.UNIT+F.FNB
	OFFSET	S.FDB		;SIZE OF FDB
	.MACRO	FDOFF$	ARG
	.ENDM	FDOFF$
	.ENDM	FDOFF$
; BUFFER DESCRIPTOR OFFSETS-SAME TYPE OF CALL AS FOR FILE DESCRIPTOR OFFSETS
	.MACRO	BDOFF$ OFFSET
	.MCALL	OFFSET,DEF$I
	DEF$I	0
	OFFSET	,4
	OFFSET	B.VBN,4		;VIRTUAL BLOCK NUMBER FOR THIS BUFFER
	OFFSET	B.BBFS,2	;NUMBER OF BYTES READ OR WRITTEN
	OFFSET	B.NXBD,2	;POINTER TO NEXT BUFFER DESCRIPTOR
	OFFSET	,1		;SPARE BYTE
	OFFSET	B.BFST,1	;BUFFER STATUS BYTE
	OFFSET	,2		;SPARE WORD
	OFFSET	S.BFHD
	.IIF	IDN,<DEF$N>,<OFFSET>,.MEXIT
	.MACRO	BDOFF$	ARG
	.ENDM	BDOFF$
	.ENDM	BDOFF$

; NAME BLOCK OFFSET - LIKE FDOFF
	.MACRO	NBOFF$	OFFSET
	.MCALL	OFFSET,DEF$I,DEF$L
	DEF$I	0
	OFFSET	S.FNAM		;DEFINE AS GLOBAL IF PARAMETER
	OFFSET	S.FTYP		;IS DEF$G
	OFFSET	S.FNTY
	OFFSET	S.FNBW
	S.FNAM=6		;SIZE OF FILENAME IN BYTES
	S.FTYP=2		;SIZE OF FILE TYPE IN BYTES
	S.FNTY=<S.FNAM+S.FTYP>/2  ;SIZE OF FILENAME + TYPE IN WORDS
	OFFSET	N.FID,6		;FILE ID
	OFFSET	N.FNAM,S.FNAM	;FILENAME
	OFFSET	N.FTYP,S.FTYP	;TYPE
	OFFSET	N.FVER,2	;VERSION
	OFFSET	S.NFEN		;SIZE OF NAME FILE ENTRY IN BYTES
	DEF$L	S.NFEN		;FORCE AT LEAST A LOCAL DEFINITION
	OFFSET	N.STAT,2	;STATUS
	OFFSET	N.NEXT,2	;TEMP CELL FOR FIND NEXT
	OFFSET	N.DID,6		;DIRECTORY ID
	OFFSET	N.DVNM,2	;DEVICE NAME IN ASCII
	OFFSET	N.UNIT,2	;UNIT NUMBER
	OFFSET	S.FNB		;SIZE OF FNB IN BYTES
	DEF$L	S.FNB		;FORCE LOCAL DEFINITION AT LEAST
	S.FNBW=S.FNB/2		;SIZE OF FNB IN WORDS
	.IIF	IDN,<DEF$N>,<OFFSET>,.MEXIT ;DON'T REDEFINE THE MACRO
	.MACRO	NBOFF$	ARG
	.ENDM	NBOFF$
	.ENDM	NBOFF$
;
; FILE STORAGE REGION OFFSETS - LIKE FDOFF
	.MACRO	FSROF$	OFFSET
	.MCALL	OFFSET,DEF$I,DEF$L
;
; DEFINE THE OFFSETS FOR $$FSR2
	DEF$I	0

	OFFSET	,4		;LIST HEAD FOR ALLOCATION
	OFFSET	A.BFSR,2	;FIRST ADDRESS IN FSR1
	OFFSET	A.EFSR,2	;LAST ADDRESS IN FSR1
;
; ***** DO NOT SEPARATE THE FOLLOWING 2 DEFINITIONS
;
	OFFSET	A.OWUI,2	;UIC OF OWNER (FROM TASK HEADER)
	OFFSET	A.FIPR,2	;DEFAULT FILE PROTECTION WORD
;
; DO NOT SEPARATE THE PRECEEDING 2 DEFINITIONS
;
; ***** DO NOT SEPARATE THE FOLLOWING 3 DEFINTIONS
;
	OFFSET	A.DPB,24.	;QI/O DPB AND SCRATCH AREA
	OFFSET	A.IOST,4	;SCRATCH I/O STATUS BLOCK
	OFFSET	A.DFDR,24.	;DEFAULT DIRECTORY INFORMATION
;
; DO NOT SEPARATE THE PRECEEDING 3 DEFINITIONS
;
	OFFSET	A.DFBC,2	;DEFAULT BUFFER CNT (MULTIPLE BUFFERING)
	OFFSET	S.FSR2		;SIZE OF FILE STORAGE REGION 2
	DEF$L	S.FSR2
;
; DEFINE OFFSETS RELATIVE TO BEGINNING OF THE DEFAULT DIRECTORY INFO

	DEF$I	0

	OFFSET	,14.
	OFFSET	D.DFID,6	;DEFAULT DIRECTORY ID
	OFFSET	D.DFDV,2	;DEV NAME FOR DFLT DIR ID
	OFFSET	D.DFUN,2	;UNIT NUMBER FOR DFLT DIR ID
;
	.IIF	IDN,<DEF$N>,<OFFSET>,.MEXIT
	.MACRO	FSROF$	ARG
	.ENDM	FSROF$
	.ENDM	FSROF$
;
; DEFINE OFFSETS RELATIVE TO THE FILE DESCRIPTOR POINTER, F.DSPT
	.MACRO	FDSOF$	OFFSET
	.MCALL	OFFSET,DEF$I,DEF$L
	DEF$I	0
;
	OFFSET	N.DEVD,4	;DEVICE STRING DESCRIPTOR
	OFFSET	N.DIRD,4	;DIRECTORY STRING DESCRIPTOR
	OFFSET	N.FNMD,4	;FILE NAME STRING DESCRIPTOR
	OFFSET	S.FIDS
	.IF	IDN,<DEF$N>,<OFFSET>
	DEF$L	S.FIDS
	.MEXIT
	.ENDC
	.MACRO	FDSOF$	ARG
	.ENDM	FDSOF$
	.ENDM	FDSOF$
	.MACRO	DEF$G VAR,SIZ	;DEFINE GLOBAL OFFSET
	.MCALL	DEF$L
	.IIF	NB,VAR,.GLOBL VAR
	DEF$L	VAR,SIZ
	.ENDM	DEF$G

	.MACRO	DEF$N VAR,SIZ	;DEFINE NO OFFSET-CALCULATE THE SIZE
	.MCALL	DEF$L
	DEF$L	,SIZ
	.ENDM	DEF$N

	.MACRO	DEF$I IVAL	;INITIALIZE DEFINITION
	...TPC=IVAL		;MACROS PROGRAM COUNTER
	.ENDM	DEF$I

	.MACRO	DEF$L SYM,SIZ
	.IF NB,SYM
	SYM=...TPC
	.ENDC
	.IF NB,SIZ
	...TPC=...TPC+SIZ
	.ENDC
	.ENDM	DEF$L
;
	.MACRO	RAD50$	STRING,MAXWRD
	...PC2=.
	.RAD50	/STRING/
	.IF	GT,<.-...PC2>-<2*MAXWRD>
	.ERROR	STRING		;RAD50 - STRING TOO LONG, TRUNCATED;
	.=...PC2+2*MAXWRD
	.MEXIT
	.ENDC
	.REPT	MAXWRD-<<.-...PC2>/2>
	.WORD	0
	.ENDR
	.ENDM	RAD50$
	.IIF	NDF,S$$YDF,.NLIST
	.TITLE	F11MAC
	.IDENT	/0005/

;
;                             COPYRIGHT (C) 1973, 1978 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 THERE-
;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;       THE INFORMATION CONTAINED 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 SUPPILED BY DIGITAL.
;
; ANDREW C. GOLDSTEIN  19 NOV 74  16:48
; PETER H. LIPMAN 12/28/73

;
; DEFINE FILES 11 FILE HEADER OFFSETS
;
;	FHDOF$			;DEFINE OFFSETS LOCALLY
;	FHDOF$	DEF$L		;DEFINE OFFSETS LOCALLY
;
;	FHDOF$	DEF$G		;DEFINE OFFSETS GLOBALLY
;
	.MACRO	FHDOF$	GLOBAL
	.MCALL	FHDO1$

	...GBL=0
	.IF	B,GLOBAL
	FHDO1$	DEF$L

	.IFF
	.IF	IDN,<GLOBAL>,<DEF$G>
	...GBL=1
	.ENDC
	FHDO1$	GLOBAL
	.ENDC

	.IF	DIF,<GLOBAL>,<DEF$N>
	.MACRO	FHDOF$	ARG1	;REDEFINE MACRO
	.ENDM	FHDOF$
	.ENDC
	.ENDM	FHDOF$
	.MACRO	FHDO1$	OFFSET
	.MCALL	DEF$I,OFFSET,DEFIN$
;
; HEADER AREA OFFSETS
;
	DEF$I	0

	OFFSET	H.IDOF,1	;IDENT AREA OFFSET IN WORDS
	OFFSET	H.MPOF,1	;MAP AREA OFFSET IN WORDS
	OFFSET	H.FNUM,2	;FILE NUMBER
	OFFSET	H.FSEQ,2	;FILE SEQUENCE NUMBER
	OFFSET	H.FLEV,2	;STRUCTURE LEVEL AND SYSTEM NUMBER
	OFFSET	H.FOWN		;OWNER OF FILE CONSISTING OF
	OFFSET	H.PROG,1	;PROGRAMMER NUMBER
	OFFSET	H.PROJ,1	;PROJECT NUMBER
	OFFSET	H.FPRO,2	;FILE PROTECTION CODE
;
; FILE PROTECTION BITS
;
	DEFIN$	FP.RDV,1	;READ ACCESS ALLOWED IF CLEAR
	DEFIN$	FP.WRV,2	;WRITE ACCESS ALLOWED IF CLEAR
	DEFIN$	FP.EXT,4	;EXTEND ACCESS ALLOWED IF CLEAR
	DEFIN$	FP.DEL,10	;DELETE ALLOWED IF CLEAR
	DEFIN$	FP.RAT,1	;READ ATTRIBUTES ALLOWED IF CLEAR

	OFFSET	H.FCHA		;FILE CHARACTERISTICS CODE-CONSISTING OF
	OFFSET	H.UCHA,1	;USER CONTROLLED CHARACTERISTICS BYTE
;
; BIT DEFINTIONS FOR USER CONTROLLED CHARACTERISTICS BYTE
;
	DEFIN$	UC.CON,200	;FILE IS LOGICALLY CONTIGUOUS IF SET
	DEFIN$	UC.DLK,100	;DEACCESS LOCK SET IF BIT IS SET

	OFFSET	H.SCHA,1	;SYSTEM CONTROLLED CHARACTERISTICS BYTE
;
; BIT DEFINITIONS FOR SYSTEM CONTROLLED CHARACTERISTICS BYTE
;
	DEFIN$	SC.MDL,200	;MARKED FOR DELETE IF SET
	DEFIN$	SC.BAD,100	;BAD DATA BLOCK IN FILE IF SET

	OFFSET	H.UFAT,32.	;USER FILE ATTRIBUTES
	OFFSET	S.HDHD		;SIZE IN BYTES OF HEADER AREA
;
; IDENT AREA OFFSETS
;
	DEF$I	0

	OFFSET	I.FNAM,6	;FILE NAME IN RAD50
	OFFSET	I.FTYP,2	;FILE TYPE IN RAD50
	OFFSET	I.FVER,2	;FILE VERSION NUMBER IN BINARY
	OFFSET	I.RVNO,2	;REVISION NUMBER
	OFFSET	I.RVDT,7	;REVISION DATE
	OFFSET	I.RVTI,6	;REVISION TIME
	OFFSET	I.CRDT,7	;CREATION DATE
	OFFSET	I.CRTI,6	;CREATION TIME
	OFFSET	I.EXDT,7	;EXPIRATION DATE
	OFFSET	,1		;ROUND UP TO WORD BOUNDARY

	OFFSET	S.IDHD		;SIZE IN BYTES OF IDENT AREA

	DEFIN$	I.DASZ,7	;NO. OF BYTES IN DATE STRING
	DEFIN$	I.TISZ,6	;NO. OF BYTES IN TIME STRING
;
; MAP AREA OFFSET
;

	DEF$I	0

	OFFSET	M.ESQN,1	;EXTENSION SEQUENCE NUMBER
	OFFSET	M.ERVN,1	;EXTENSION RELATIVE VOLUME NUMBER
	OFFSET	M.EFNU,2	;EXTENSION FILE NUMBER
	OFFSET	M.EFSQ,2	;EXTENSION FILE SEQUENCE NUMBER
	OFFSET	M.CTSZ,1	;BLOCK COUNT FIELD SIZE
	OFFSET	M.LBSZ,1	;LOGICAL BLOCK NUMBER FIELD SIZE
	OFFSET	M.USE,1		;WORDS IN USE IN THE MAP
	OFFSET	M.MAX,1		;MAX NO. OF WORDS AVAILABLE IN MAP
	OFFSET	M.RTRV		;START OF RETRIEVAL POINTERS
	OFFSET	S.MPHD		;SIZE IN BYTES OF THE MAP AREA
;
; CHECKSUM FOR FILE HEADER
;
	DEFIN$	H.CKSM,510.	;SUM OF WORDS 0-255.

	.IF	DIF,<OFFSET>,<DEF$N>
	.MACRO	FHDO1$	ARG1
	.ENDM	FHDO1$
	.ENDC

	.ENDM	FHDO1$
;
; DEFINE FILES 11 HOME BLOCK OFFSETS
;
;	HMBOF$			;DEFINE OFFSETS LOCALLY
;	HMBOF$	DEF$L		;DEFINE OFFSETS LOCALLY
;
;	HMBOF$	DEF$G		;DEFINE OFFSETS GLOBALLY
;

	.MACRO	HMBOF$	GLOBAL
	.MCALL	HMBO1$

	...GBL=0
	.IF	B,GLOBAL
	HMBO1$	DEF$L

	.IFF
	.IF	IDN,<GLOBAL>,<DEF$G>
	...GBL=1
	.ENDC
	HMBO1$	GLOBAL
	.ENDC
	.IF	DIF,<GLOBAL>,<DEF$N>
	.MACRO	HMBOF$	ARG1
	.ENDM	HMBOF$
	.ENDC

	.ENDM	HMBOF$

	.MACRO	HMBO1$	OFFSET
	.MCALL	DEF$I,OFFSET,DEFIN$

	DEF$I	0

	OFFSET	H.IBSZ,2	;INDEX BIT MAP SIZE
	OFFSET	H.IBLB,4	;INDEX BIT MAP LBN
	OFFSET	H.FMAX,2	;MAXIMUM NO. OF FILES ON VOLUME
	OFFSET	H.SBCL,2	;STORAGE BIT MAP CLUSTER FACTOR
	OFFSET	H.DVTY,2	;DISK DEVICE TYPE
	OFFSET	H.VLEV,2	;STRUCTURE  LEVEL
	OFFSET	H.VNAM,12.	;VOLUME NAME -ASCII
	OFFSET	,4		;RESERVED
	OFFSET	H.VOWN,2	;VOLUME OWNER'S UIC
	OFFSET	H.VPRO,2	;VOLUME PROTECTION CODE
	OFFSET	H.VCHA,2	;VOLUME CHARACTERISTICS
;
; NEW HOME BLOCK INFORMATION DOWN TO H.FIEX
;
	OFFSET	H.FPRO,2	;DEFAULT FILE PROTECTION
	.IF	DF,R$$11M
	OFFSET	H.VFSQ,2	;VOLUME FILE SEQUENCE NUMBER
				;UPDATED BY DISMOUNT
	.IFF
	OFFSET	,2		;NOT USED
	.ENDC
	OFFSET	,4		;NOT USED
	OFFSET	H.WISZ,1	;WINDOW SIZE FOR ALL FILES ON VOLUME
	OFFSET	H.FIEX,1	;DEFAULT FILE EXTEND IN BLOCKS
	OFFSET	H.LRUC,1	;NUMBER OF ENTRIES IN DIRECTORY LRU
	OFFSET	,11.		;AVAILABLE
	OFFSET	H.CHK1,2	;CHECKSUM OF WORDS 0-28.
	OFFSET	H.VDAT,14.	;CREATION DATE
	OFFSET	,398.		;RESERVED FOR RELATIVE VOLUME TABLE
	OFFSET	H.INDN,12.	;SYSTEM INDEPENDENT VOLUME NAME
	OFFSET	H.INDO,12.	;SYSTEM INDEPENDENT OWNER NAME
	OFFSET	H.INDF,12.	;SYSTEM INDEPENDENT FORMAT TYPE
	OFFSET	,2		; NOT USED
	OFFSET	H.CHK2,2	;CHECKSUM OF WORDS 0-255.

	.IF	DIF,<OFFSET>,<DEF$N>
	.MACRO	HMBO1$	ARG1
	.ENDM	HMBO1$
	.ENDC

	.ENDM	HMBO1$

	.IIF	NDF,S$$YDF,.LIST
	.IIF	NDF,S$$YDF,.NLIST
	.TITLE	F11TBL	FILES 11 TABLE DEFINITIONS
	.IDENT	/0014/
;
;                             COPYRIGHT (C) 1973, 1978 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 THERE-
;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;       THE INFORMATION CONTAINED 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 SUPPILED BY DIGITAL.
;
; ANDREW C. GOLDSTEIN  17 JAN 1975  10:30
; PETER H. LIPMAN 12/27/73

	.MACRO	F11DF$
;
; VOLUME CONTROL BLOCK
;
	.ASECT
.=0
V.TRCT:	.BLKW	1		;TRANSACTION COUNT
V.IFWI:	.BLKW	1		;INDEX FILE WINDOW
	.IF	DF,R$$11D
V.STD:	.BLKW	1		;STD OF TASK CHARGED WITH NODE
	.ENDC
V.FCB:	.BLKW	2		;FILE CONTROL BLOCK LIST HEAD
V.IBLB:	.BLKB	1		;INDEX BIT MAP 1ST LBN HIGH BYTE
V.IBSZ:	.BLKB	1		;INDEX BIT MAP SIZE IN BLOCKS
	.BLKW	1		;INDEX BITMAP 1ST LBN LOW BITS
V.FMAX:	.BLKW	1		;MAX NO. OF FILES ON VOLUME
V.WISZ:	.BLKB	1		;DFLT SIZE OF WINDOW IN NO. OF RTRV PTRS
				;VALUE IS < 128.
V.SBCL:	.BLKB	1		;STORAGE BIT MAP CLUSTER FACTOR
V.SBSZ:	.BLKW	1		;STORAGE BIT MAP SIZE IN BLOCKS
V.SBLB:	.BLKB	1		;STORAGE BIT MAP 1ST LBN HIGH BYTE
V.FIEX:	.BLKB	1		;DEFAULT FILE EXTEND SIZE
	.BLKW	1		;STORAGE BIT MAP 1ST LBN LOW BITS
	.IF	DF,R$$11M
V.VOWN:	.BLKW	1		;VOLUME OWVER'S UIC
V.VPRO:	.BLKW	1		;VOLUME PROTECTION
V.VCHA:	.BLKW	1		;VOLUME CHARACTERISTICS
	.IFTF
V.FPRO:	.BLKW	1		;VOLUME DEFAULT FILE PROTECTION
	.IFT
V.VFSQ:	.BLKW	1		;VOLUME FILE SEQUENCE NUMBER
	.IFF
	.BLKW	1		;NOT USED
	.ENDC
V.FRBK:	.BLKB	1		;NUMBER OF FREE BLOCKS ON VOLUME HIGH BYTE
V.LRUC:	.BLKB	1		;COUNT OF AVAILABLE LRU SLOTS IN FCB LIST
	.BLKW	1		;NUMBER OF FREE BLOCKS ON VOLUME LOW BITS
	.IF	DF,R$$11D
V.LABL:	.BLKB	12.		;VOLUME LABEL (ASCII)
V.STAT:	.BLKB	1		;VOLUME STATUS BYTE, CONTAINING THE FOLLOWING
	VC.IFW=	1		; INDEX FILE IS WRITE ACCESSED
	VC.BMW=	2		; STORAGE BITMAP FILE IS WRITE ACCESSED
V.FFNU:	.BLKB	1		; FIRST FREE INDEX FILE BITMAP BLOCK
	.ENDC
V.LGTH:				;SIZE IN BYTES OF VCB
;
; FILE CONTROL BLOCK
;
	.ASECT
.=0
F.LINK:	.BLKW	1		;FCB CHAIN POINTER
	.IF	DF,R$$11D
F.FEXT:	.BLKW	1		;POINTER TO EXTENSION FCB
F.STD:	.BLKW	1		;STD OF TASK CHARGED WITH NODE
	.ENDC
F.FNUM:	.BLKW	1		;FILE NUMBER
F.FSEQ:	.BLKW	1		;FILE SEQUENCE NUMBER
F.RVN:	.BLKB	1		;RELATIVE VOLUME NUMBER OF FILE
F.FSQN:	.BLKB	1		;FILE SEGMENT NUMBER
F.FOWN:	.BLKW	1		;FILE OWNER'S UIC
F.FPRO:	.BLKW	1		;FILE PROTECTION CODE
F.UCHA:	.BLKB	1		;USER CONTROLLED CHARACTERISTICS
F.SCHA:	.BLKB	1		;SYSTEM CONTROLLED CHARACTERISTICS
F.HDLB:	.BLKW	2		;FILE HEADER LOGICAL BLOCK NUMBER
				;BEGINNING OF STATISTICS BLOCK
F.LBN:	.BLKW	2		;LBN OF VIRTUAL BLOCK 1 IF CONTIGUOUS
				;0 IF NON CONTIGUOUS
F.SIZE:	.BLKW	2		;SIZE OF FILE IN BLOCKS
F.NACS:	.BLKB	1		;NO. OF ACCESSES
F.NLCK:	.BLKB	1		;NO. OF LOCKS
	S.STBK=.-F.LBN		;SIZE OF STATICS BLOCK
F.STAT:				;FCB STATUS WORD

F.NWAC:	.BLKB	1		;NUMBER OF WRITE ACCESSORS
	.BLKB	1		;STATUS BITS FOR FCB CONSISTING OF
	FC.WAC=100000		;SET IF FILE ACCESSED FOR WRITE
	FC.DIR=40000		;SET IF FCB IS IN DIRECTORY LRU
	FC.CEF=20000		;SET IF DIRECTORY EOF NEEDS UPDATING
	FC.FCO=10000		;SET IF TRYING TO FORCE DIRECTORY CONTIG
F.DREF:	.BLKW	1		;DIRECTORY EOF BLOCK NUMBER
F.DRNM:	.BLKW	1		;1ST WORD OF DIRECTORY NAME
	.IF	DF,R$$11D
F.FVBN:	.BLKW	2		;STARTING VBN OF THIS FILE SEGMENT
	.ENDC
F.LGTH:				;SIZE IN BYTES OF FCB

;
; WINDOW
;
	.ASECT
.=0
W.CTL:	.BLKW	1		;LOW BYTE = # OF MAP ENTRIES ACTIVE
				;HIGH BYTE CONSISTS OF THE FOLLOWING BITS
	WI.RDV=400		;READ VIRTUAL BLOCK ALLOWED IF SET
	WI.WRV=1000		;WRITE VIRTUAL BLOCK ALLOWED IF SET
	WI.EXT=2000		;EXTEND ALLOWED IF SET
	WI.LCK=4000		;SET IF LOCKED AGAINST SHARED ACCESS
	WI.DLK=10000		;SET IF DEACCESS LOCK ENABLED
	WI.BPS=100000		;BYPASS ACCESS INTERLOCK IF SET
	.IF	DF,R$$11M
W.VBN:	.BLKB	1		;HIGH BYTE OF 1ST VBN MAPPED BY WINDOW
W.WISZ:	.BLKB	1		;SIZE IN RTRV PTRS OF WINDOW (7 BITS)
	.BLKW	1		;LOW ORDER WORD OF 1ST VBN MAPPED
W.FCB:	.BLKW	1		;FILE CONTROL BLOCK ADDRESS
	.ENDC
	.IF	DF,R$$11D
W.FCB:	.BLKW	1		;FILE CONTROL BLOCK ADDRESS
W.STD:	.BLKW	1		;STD OF TASK CHARGED WITH WIDOW NODE
W.VBN:	.BLKB	1		;HIGH BYTE OF 1ST VBN MAPPED BY WINDOW
W.WISZ:	.BLKB	1		;SIZE IN RTRV PTRS OF WINDOW (7 BITS)
	.BLKW	1		;LOW ORDER WORD OF 1ST VBN MAPPED
	.ENDC
W.RTRV:				;OFFSET TO 1ST RETRIEVAL POINTER IN WINDOW

	.PSECT
	.MACRO	F11DF$
	.ENDM	F11DF$
	.ENDM	F11DF$
	.IIF	NDF,S$$YDF,.LIST
;                             COPYRIGHT (C) 1973, 1978 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 THERE-
;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;       THE INFORMATION CONTAINED 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 SUPPILED BY DIGITAL.
;
; GCML MACRO DEFINITIONS
;
;
; VERSION 010
;
; WRITTEN BY:
;	R.B. GROVE	25-APR-73, BASE LEVEL 6B VERSION
;
; MODIFIED BY:
;	C.A. D'ELIA	19-OCT-73 (FOR RSX-11D V003A)
;	C.A. D'ELIA	28-MAR-74 (FOR GCML VERSION 09)
;	C.A. D'ELIA	01-AUG-74
;	C.A. D'ELIA	20-JAN-75
;
;
 
;
; GCMLB$ - GENERATE A CONTROL BLOCK FOR GCML$
;
	.MACRO	GCMLB$	MAXD,PRMPT,UBUF,LUN,PDL,?PDL1,?DFNB,?BUF
 
	.MCALL	FDBDF$,FDAT$A,FDOP$A,NMBLK$,FDBF$A,CBYTE$
 
	FDBDF$			;DEFINE FDB
	FDAT$A	2
	.IF NB	<LUN>
	FDOP$A	LUN,,DFNB
	.IFF
	FDOP$A	1,,DFNB
	.ENDC
	FDBF$A	,,1		;FORCE SINGLE BUFFERING
 
	CBYTE$	<FD.TTY!FD.REC!FD.CCL>,F.RCTL  ;FUDGE INITIAL ATTRIBUTES
 
 
	.MCALL	GCMLD$
	GCMLD$			;DEFINE GCML OFFSETS
 
	.BYTE	0,GE.COM!GE.IND!GE.CLO  ;ERROR AND MODE BYTES
	.BLKW	4		;PROMPT STR AND CMD DESCRIPTORS
	.BYTE	-1,MAXD		;CURRENT AND MAXIMUM DEPTHS
 
	.IF B	<PDL>
	.WORD	PDL1		;USE GENERATED PUSH-DOWN LIST
	.IFF
	.WORD	PDL		;USER SUPPLIED PUSH-DOWN LIST
	.ENDC
 
	.IF NB <UBUF>
	.WORD	UBUF
	.IFF
	.WORD	BUF
	.ENDC
 
$$$=.
	.ASCII	<15><12>
	.IF NB	<PRMPT>
	.ASCII	/PRMPT>/
	.IFF
	.ASCII	/   >/
	.ENDC
.=$$$+6
 
DFNB:	NMBLK$	CMI,CMD
 
G.LPDL=<MAXD+1>*<6+<5*2>>	;LENGTH (IN BYTES) OF REQUIRED PDL
 
	.IF B	<PDL>
PDL1:	.BLKB	G.LPDL		;GENERATE REQUIRED PUSH-DOWN STORAGE
	.ENDC
 
	.IF B	<UBUF>
BUF:	.BLKB	82.
	.ENDC
 
	.ENDM	GCMLB$
 
 
 
 
;
; GCML$  - GET COMMAND LINE MACRO
;
	.MACRO	GCML$	NAME,ADPR,LNPR
	.MCALL	GCMLD$,LDR0$
	GCMLD$	DEF$L
	LDR0$	NAME
	.IF NB	<LNPR>
	MOV	LNPR,G.PSDS(R0)
	.IIF B	<ADPR>, .ERROR ; PROMPT STRING MISSING
	.IIF NB	<ADPR>,	MOV	ADPR,G.PSDS+2(R0)
	.ENDC
	.IIF B	<LNPR>,	CLR	G.PSDS(R0)
	.GLOBL	.GCML1
	JSR	PC,.GCML1
	.ENDM	GCML$
 
 
 
 
 
;
; RCML$  - RESET COMMAND LINE SCAN TO TOP LEVEL
;
	.MACRO	RCML$	NAME
	.MCALL	LDR0$
	LDR0$	NAME
	.GLOBL	.GCML2
	JSR	PC,.GCML2
	.ENDM	RCML$
 
 
 
 
 
;
; CCML$  - CLOSE CURRENT LEVEL OF COMMAND LINE
;
	.MACRO	CCML$	BLK
	.MCALL	LDR0$
	LDR0$	BLK
	.GLOBL	.GCML3
	JSR	PC,.GCML3
	.ENDM	CCML$
 
 
 
 
 
;
; GCMLD$ - GET COMMAND LINE SYMBOL DEFINITIONS
;
	.MACRO	GCMLD$	GBL
 
	.IF NDF	S.FDB	;MUST FIRST DEFINE SIZE OF FDB
	.MCALL	FDBSZ$
	FDBSZ$
	.ENDC
 
	.MCALL	GCML$D	;NOW DEFINE GCML SYMBOLS
	GCML$D	GBL
 
	.MACRO	GCMLD$	X
	.ENDM
 
 
	.ENDM	GCMLD$
 
 
 
 
;
; GCML$D - DEFINE GCML SYMBOLS (CALLED BY GCMLD$)
;
 
	.MACRO	GCML$D	GBL
 
	.IF IDN	<GBL>,<DEF$G>
	.GLOBL	G.ERR,G.MODE,G.PSDS,G.CMLD
	.GLOBL	GE.COM,GE.IND,GE.CLO,GE.LC
	.GLOBL	GE.IOR,GE.OPR,GE.BIF,GE.MDE,GE.EOF
	.ENDC
 
 
G.ERR	= S.FDB		;ERROR RETURN CODE BYTE
G.MODE	= G.ERR+1	;STATUS AND MODE CONTROL BYTE
G.PSDS	= G.ERR+2	;PROMPT STRING DESCRIPTOR
G.CMLD	= G.ERR+6	;COMMAND LINE DESCRIPTOR
G.ISIZ	= 16.		;SIZE OF IMPURE AREA (PTRS,FLAGS,COUNTS,ETC)
G.DPRM	= G.ERR+G.ISIZ	;DEFAULT PROMPT STRING
;
; G.MODE BIT DEFINITIONS
;
GE.COM	= 1		;COMMENT RECOGNITION
GE.IND	= 2		;INDIRECT FILE RECOGNITION
GE.CLO	= 4		;CLOSE COMMAND FILE BEFORE RETURN
GE.LC	= 10		;PASS LOWER CASE CHARACTERS
;
; G.ERR VALUES
;
GE.IOR	= -1		;I/O ERRER
GE.OPR	= -2		;UNABLE TO OPEN INDIRECT FILE
GE.BIF	= -3		;BAD INDIRECT FILE NAME
GE.MDE	= -4		;MAXIMUM INDIRECT FILE DEPTH EXCEEDED
GE.EOF	= -10.		;END OF FILE
;
; MACRO REDEFINITION
;
	.MACRO	GCML$D	X
	.ENDM
 
	.ENDM	GCML$D
	.TITLE	QIOMAC - QIOSYM MACRO DEFINITION
; ALTERED SUNDAY 24-NOV-74 13:00
; ALTERED TUESDAY 28-JAN-75 13:50:00
;
; ***** ALWAYS UPDATE THE FOLLOWING TWO LINES TOGETHER
	.IDENT	/0300/
	QI.VER=0300
;
;                             COPYRIGHT (C) 1973, 1978 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 THERE-
;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;       THE INFORMATION CONTAINED 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 SUPPILED BY DIGITAL.

;
; PETER H. LIPMAN 1-OCT-73
;
;+
; MACRO TO DEFINE STANDARD QUEUE I/O DIRECTIVE FUNCTION VALUES
; AND IOSB RETURN VALUES.  TO INVOKE AT ASSEMBLY TIME (WITH LOCAL
; DEFINITION) USE:
;
;	QIOSY$		;DEFINE SYMBOLS
;
; TO OBTAIN GLOBAL DEFINITION OF THESE SYMBOLS USE:
;
;	QIOSY$ DEF$G	;SYMBOLS DEFINED GLOBALLY
;
; THE MACRO CAN BE CALLED ONCE ONLY AND THEN
; REDEFINES ITSELF AS NULL.
;-

	.MACRO	QIOSY$	$$$GBL,$$$MSG
	.IIF	IDN,<$$$GBL>,<DEF$G>,	.GLOBL	QI.VER
	.IF	IDN,<$$$MSG>,<DEF$S>
	$$$MAX=0
	$$MSG=1
	.IFF
	$$MSG=0
	.ENDC
	.MCALL	IOERR$
	IOERR$	$$$GBL	 	;I/O ERROR CODES FROM HANDLERS, FCP, FCS
	.MCALL	DRERR$
	DRERR$	$$$GBL	 	;DIRECTIVE STATUS WORD ERROR CODES
	.IF	DIF,<$$$MSG>,<DEF$S>
	.MCALL	FILIO$
	FILIO$	$$$GBL		;DEFINE GENERAL QI/O FUNCTION CODES
	.MCALL	SPCIO$
	SPCIO$	$$$GBL		;DEVICE DEPENDENT I/O FUNCTION CODES
	.MACRO	QIOSY$	ARG,ARG1,ARG2	;RECLAIM MACRO STORAGE
	.ENDM	QIOSY$
	.ENDC
	.ENDM	QIOSY$

;
; DEFINE THE ERROR CODES RETURNED BY DEVICE HANDLER AND FILE PRIMITIVES
; IN THE FIRST WORD OF THE I/O STATUS BLOCK
; THESE CODES ARE ALSO RETURNED BY FILE CONTROL SERVICES (FCS) IN THE
; BYTE F.ERR IN THE FILE DESCRIPTOR BLOCK (FDB)
;	THE BYTE F.ERR+1 IS 0 IF F.ERR CONTAINS A HANDLER OR FCP ERROR CODE.
;
	.MACRO	IOERR$	$$$GBL
	.MCALL	.IOER.,DEFIN$
	.IF	IDN,<$$$GBL>,<DEF$G>
	...GBL=1
	.IFF
	...GBL=0
	.ENDC
	.IIF	NDF,$$MSG,$$MSG=0
;
; SYSTEM STANDARD CODES, USED BY ALL FUNCTIONS
;
	.IOER.	IE.BAD,-01.,<BAD PARAMETERS>
	.IOER.	IE.EBX,-02.,<E BOX STOPPED>
	.IOER.	IE.IFC,-02.,<INVALID FUNCTION CODE>
	.IOER.	IE.DNR,-03.,<DEVICE NOT READY>
	.IOER.	IE.VER,-04.,<PARITY ERROR ON DEVICE>
	.IOER.	IE.ONP,-05.,<HARDWARE OPTION NOT PRESENT>
	.IOER.	IE.SPC,-06.,<ILLEGAL USER BUFFER>
	.IOER.	IE.DNA,-07.,<DEVICE NOT ATTACHED>
	.IOER.	IE.DAA,-08.,<DEVICE ALREADY ATTACHED>
	.IOER.	IE.DUN,-09.,<DEVICE NOT ATTACHABLE>
	.IOER.	IE.EOF,-10.,<END OF FILE DETECTED>
	.IOER.	IE.EOV,-11.,<END OF VOLUME DETECTED>
	.IOER.	IE.WLK,-12.,<WRITE ATTEMPTED TO LOCKED UNIT>
	.IOER.	IE.DAO,-13.,<DATA OVERRUN>
	.IOER.	IE.SRE,-14.,<SEND/RECEIVE FAILURE>
	.IOER.	IE.ABO,-15.,<REQUEST TERMINATED>
	.IOER.	IE.PRI,-16.,<PRIVILEGE VIOLATION>
	.IOER.	IE.RSU,-17.,<SHARABLE RESOURCE IN USE>
	.IOER.	IE.OVR,-18.,<ILLEGAL OVERLAY REQUEST>
	.IOER.	IE.BYT,-19.,<ODD BYTE COUNT (OR VIRTUAL ADDRESS)>
	.IOER.	IE.BLK,-20.,<LOGICAL BLOCK NUMBER TOO LARGE>
	.IOER.	IE.MOD,-21.,<INVALID UDC MODULE #>
	.IOER.	IE.CON,-22.,<UDC CONNECT ERROR>
	.IOER.	IE.BBE,-56.,<BAD BLOCK ON DEVICE>
	.IOER.	IE.STK,-58.,<NOT ENOUGH STACK SPACE (FCS OR FCP)>
	.IOER.	IE.FHE,-59.,<FATAL HARDWARE ERROR ON DEVICE>
	.IOER.	IE.EOT,-62.,<END OF TAPE DETECTED>
	.IOER.	IE.OFL,-65.,<DEVICE OFF LINE>


;
; FILE PRIMITIVE CODES 
;

	.IOER.	IE.NOD,-23.,<CALLER'S NODES EXHAUSTED>
	.IOER.	IE.DFU,-24.,<DEVICE FULL>
	.IOER.	IE.IFU,-25.,<INDEX FILE FULL>
	.IOER.	IE.NSF,-26.,<NO SUCH FILE>
	.IOER.	IE.LCK,-27.,<LOCKED FROM WRITE ACCESS>
	.IOER.	IE.HFU,-28.,<FILE HEADER FULL>
	.IOER.	IE.WAC,-29.,<ACCESSED FOR WRITE>
	.IOER.	IE.CKS,-30.,<FILE HEADER CHECKSUM FAILURE>
	.IOER.	IE.WAT,-31.,<ATTRIBUTE CONTROL LIST FORMAT ERROR>
	.IOER.	IE.RER,-32.,<FILE PROCESSOR DEVICE READ ERROR>
	.IOER.	IE.WER,-33.,<FILE PROCESSOR DEVICE WRITE ERROR>
	.IOER.	IE.ALN,-34.,<FILE ALREADY ACCESSED ON LUN>
	.IOER.	IE.SNC,-35.,<FILE ID, FILE NUMBER CHECK>
	.IOER.	IE.SQC,-36.,<FILE ID, SEQUENCE NUMBER CHECK>
	.IOER.	IE.NLN,-37.,<NO FILE ACCESSED ON LUN>
	.IOER.	IE.CLO,-38.,<FILE WAS NOT PROPERLY CLOSED>
	.IOER.	IE.DUP,-57.,<ENTER - DUPLICATE ENTRY IN DIRECTORY>
	.IOER.	IE.BVR,-63.,<BAD VERSION NUMBER>
	.IOER.	IE.BHD,-64.,<BAD FILE HEADER>
	.IOER.	IE.EXP,-66.,<FILE EXPIRATION DATE NOT REACHED>
	.IOER.	IE.BTF,-67.,<BAD TAPE FORMAT>

;
; FILE CONTROL SERVICES CODES
;

	.IOER.	IE.NBF,-39.,<OPEN - NO BUFFER SPACE AVAILABLE FOR FILE>
	.IOER.	IE.RBG,-40.,<ILLEGAL RECORD SIZE>
	.IOER.	IE.NBK,-41.,<FILE EXCEEDS SPACE ALLOCATED, NO BLOCKS>
	.IOER.	IE.ILL,-42.,<ILLEGAL OPERATION ON FILE DESCRIPTOR BLOCK>
	.IOER.	IE.BTP,-43.,<BAD RECORD TYPE>
	.IOER.	IE.RAC,-44.,<ILLEGAL RECORD ACCESS BITS SET>
	.IOER.	IE.RAT,-45.,<ILLEGAL RECORD ATTRIBUTES BITS SET>
	.IOER.	IE.RCN,-46.,<ILLEGAL RECORD NUMBER - TOO LARGE>
	.IOER.	IE.MBK,-47.,<MULTIPLE BLOCK READ/WRITE - NOT IMPLEMENTED YET>
	.IOER.	IE.2DV,-48.,<RENAME - 2 DIFFERENT DEVICES>
	.IOER.	IE.FEX,-49.,<RENAME - NEW FILE NAME ALREADY IN USE>
	.IOER.	IE.BDR,-50.,<BAD DIRECTORY FILE>
	.IOER.	IE.RNM,-51.,<CAN'T RENAME OLD FILE SYSTEM>
	.IOER.	IE.BDI,-52.,<BAD DIRECTORY SYNTAX>
	.IOER.	IE.FOP,-53.,<FILE ALREADY OPEN>
	.IOER.	IE.BNM,-54.,<BAD FILE NAME>
	.IOER.	IE.BDV,-55.,<BAD DEVICE NAME>
	.IOER.	IE.NFI,-60.,<FILE ID WAS NOT SPECIFIED>
	.IOER.	IE.ISQ,-61.,<ILLEGAL SEQUENTIAL OPERATION>
	.IOER.	IE.NNC,-68.,<NOT ANSI 'D' FORMAT BYTE COUNT>

;
; SUCCESSFUL RETURN CODES---
;

	DEFIN$	IS.PND,+00.	;OPERATION PENDING
	DEFIN$	IS.SUC,+01.	;OPERATION COMPLETE, SUCCESS
	DEFIN$	IS.RDD,+02.	;READ DELETED DATA (FLOPPY)
	DEFIN$	IS.BV,+05.	;ON A/D READ, AT LEAST ONE BAD VALUE
				;WAS READ (REMAINDER MAY BE GOOD).
				;BAD CHANNEL IS INDICATED BY A
				;NEGATIVE VALUE IN THE BUFFER.


;
; TTY SUCCESS CODES:
;

	DEFIN$	IS.CR,<15*400+1> ;CARRIAGE RETURN WAS TERMINATOR
	DEFIN$	IS.ESC,<33*400+1> ;ESCAPE (ALTMODE) WAS TERMINATOR


; ******
;
; THE NEXT AVAILABLE ERROR NUMBER IS: -69.
; ALL LOWER NUMBERS ARE IN USE!!
;
; *****
	.IF	EQ,$$MSG
	.MACRO	IOERR$	A
	.ENDM	IOERR$
	.ENDC
	.ENDM	IOERR$
;
; DEFINE THE DIRECTIVE ERROR CODES RETURNED IN THE DIRECTIVE STATUS WORD
;
;	FILE CONTROL SERVICES (FCS) RETURNS THESE CODES IN THE BYTE F.ERR 
; OF THE FILE DESCRIPTOR BLOCK (FDB).  TO DISTINGUISH THEM FROM THE
; OVERLAPPING CODES FROM HANDLER AND FILE PRIMITIVES, THE BYTE
; F.ERR+1 IN THE FDB WILL BE NEGATIVE FOR A DIRECTIVE ERROR CODE.
;
	.MACRO	DRERR$	$$$GBL
	.MCALL	.QIOE.,DEFIN$
	.IF	IDN,<$$$GBL>,<DEF$G>
	...GBL=1
	.IFF
	...GBL=0
	.ENDC
	.IIF	NDF,$$MSG,$$MSG=0
;
; STANDARD ERROR CODES RETURNED BY DIRECTIVES IN THE DIRECTIVE STATUS WORD
;
	.QIOE.	IE.UPN,-01.,<INSUFFICIENT DYNAMIC STORAGE>
	.QIOE.	IE.INS,-02.,<SPECIFIED TASK NOT INSTALLED>
	.QIOE.	IE.ULN,-05.,<UN-ASSIGNED LUN>
	.QIOE.	IE.HWR,-06.,<HANDLER TASK NOT RESIDENT>
	.QIOE.	IE.ACT,-07.,<TASK NOT ACTIVE>
	.QIOE.	IE.ITS,-08.,<DIRECTIVE INCONSISTENT WITH TASK STATE>
	.QIOE.	IE.CKP,-10.,<ISSUING TASK NOT CHECKPOINTABLE>
;
;
;
	.QIOE.	IE.AST,-80.,<DIRECTIVE ISSUED/NOT ISSUED FROM AST>
	.QIOE.	IE.LNL,-90.,<LUN LOCKED IN USE>
	.QIOE.	IE.IDU,-92.,<INVALID DEVICE OR UNIT>
	.QIOE.	IE.ITI,-93.,<INVALID TIME PARAMETERS>
	.QIOE.	IE.IPR,-95.,<INVALID PRIORITY ( .GT. 250.)>
	.QIOE.	IE.ILU,-96.,<INVALID LUN>
	.QIOE.	IE.IEF,-97.,<INVALID EVENT ( .GT. 64.)>
	.QIOE.	IE.ADP,-98.,<PART OF DPB OUT OF USER'S SPACE>
	.QIOE.	IE.SDP,-99.,<DIC OR DPB SIZE INVALID>
;
; SUCCESS CODES FROM DIRECTIVES - PLACED IN THE DIRECTIVE STATUS WORD
;
	DEFIN$	IS.CLR,0	;EVENT FLAG WAS CLEAR
				;FROM CLEAR EVENT FLAG DIRECTIVE
	DEFIN$	IS.SET,2	;EVENT FLAG WAS SET
				;FROM SET EVENT FLAG DIRECTIVE
;
;
	.IF	EQ,$$MSG
	.MACRO	DRERR$	A
	.ENDM	DRERR$
	.ENDC
	.ENDM	DRERR$
;
; DEFINE THE GENERAL QI/O FUNCTION CODES - DEVICE INDEPENDENT
;
	.MACRO	FILIO$	$$$GBL
	.MCALL	.WORD.,DEFIN$
	.IF	IDN,<$$$GBL>,<DEF$G>
	...GBL=1
	.IFF
	...GBL=0
	.ENDC
;
; GENERAL QI/O QUALIFIER BYTE DEFINITIONS
;
	.WORD.	IQ.X,001,000	;NO ERROR RECOVERY
	.WORD.	IQ.Q,002,000	;QUEUE REQUEST IN EXPRESS QUEUE
;;;	.WORD.	IQ.,004,000	;RESERVED
;
; EXPRESS QUEUE COMMANDS 
;

	.WORD.	IO.KIL,012,000	;KILL CURRENT REQUEST
	.WORD.	IO.RDN,022,000	;I/O RUNDOWN
	.WORD.	IO.UNL,042,000	;UNLOAD I/O HANDLER TASK
	.WORD.	IO.LTK,050,000	;LOAD A TASK IMAGE FILE
	.WORD.	IO.RTK,060,000	;RECORD A TASK IMAGE FILE
;
; GENERAL DEVICE HANDLER CODES
;
	.WORD.	IO.WLB,000,001	;WRITE LOGICAL BLOCK
	.WORD.	IO.RLB,000,002	;READ LOGICAL BLOCK
	.WORD.	IO.LOV,010,002	;LOAD OVERLAY (DISK DRIVER)
	.WORD.	IO.ATT,000,003	;ATTACH A DEVICE TO A TASK
	.WORD.	IO.DET,000,004	;DETACH A DEVICE FROM A TASK
;
; DIRECTORY PRIMITIVE CODES 
;
	.WORD.	IO.FNA,000,011	;FIND FILE NAME IN DIRECTORY
	.WORD.	IO.RNA,000,013	;REMOVE FILE NAME FROM DIRECTORY
	.WORD.	IO.ENA,000,014	;ENTER FILE NAME IN DIRECTORY
;
; FILE PRIMITIVE CODES 
;
	.WORD.	IO.CLN,000,007	;CLOSE OUT LUN
	.WORD.	IO.ACR,000,015	;ACCESS FOR READ
	.WORD.	IO.ACW,000,016	;ACCESS FOR WRITE
	.WORD.	IO.ACE,000,017	;ACCESS FOR EXTEND
	.WORD.	IO.DAC,000,020	;DE-ACCESS FILE
	.WORD.	IO.RVB,000,021	;READ VIRITUAL BLOCK
	.WORD.	IO.WVB,000,022	;WRITE VIRITUAL BLOCK
	.WORD.	IO.EXT,000,023	;EXTEND FILE
	.WORD.	IO.CRE,000,024	;CREATE FILE
	.WORD.	IO.DEL,000,025	;DELETE FILE
	.WORD.	IO.RAT,000,026	;READ FILE ATTRIBUTES
	.WORD.	IO.WAT,000,027	;WRITE FILE ATTRIBUTES
	.WORD.	IO.APV,010,030	;PRIVILEGED ACP CONTROL
	.WORD.	IO.APC,000,030	;ACP CONTROL
;
;
	.MACRO	FILIO$	A
	.ENDM	FILIO$
	.ENDM	FILIO$
;
; DEFINE THE QI/O FUNCTION CODES THAT ARE SPECIFIC TO INDIVIDUAL DEVICES
;
	.MACRO	SPCIO$	$$$GBL
	.MCALL	.WORD.,DEFIN$
	.IF	IDN,<$$$GBL>,<DEF$G>
	...GBL=1
	.IFF
	...GBL=0
	.ENDC
;
; QI/O FUNCTION CODES FOR SPECIFIC DEVICE DEPENDENT FUNCTIONS
;
	.WORD.	IO.WLV,100,001	;WRITE LOGICAL REVERSE (DECTAPE)
	.WORD.	IO.WLS,010,001	;(COMMUNICATIONS) WRITE PRECEDED BY SYNC TRAIN
	.WORD.	IO.RLV,100,002	;READ REVERSE (DECTAPE)
	.WORD.	IO.RNC,004,002	;READ - NO LOWER CASE CONVERT (TTY)
	.WORD.	IO.RAL,010,002	;READ PASSING ALL CHARACTERS (TTY)
	.WORD.	IO.RNE,020,002	;READ WITHOUT ECHO (TTY)
	.WORD.	IO.RDB,200,002	;READ BINARY MODE (CARD READER)
	.WORD.	IO.RHD,010,002	;(COMMUNICATIONS) READ, STRIP SYNC
	.WORD.	IO.CRC,020,002	;(COMMUNICATIONS) READ, DON'T CLEAR CRC
	.WORD.	IO.R1C,000,005	;READ SINGLE CHANNEL (AFC, AD01, UDC)
	.WORD.	IO.INL,000,005	;(COMMUNICATIONS) INITIALIZATION FUNCTION
	.WORD.	IO.TRM,010,005	;(COMMUNICATIONS) TERMINATION FUNCTION
	.WORD.	IO.RBC,000,006	;READ MULTICHANNELS (BUFFER DEFINES CHANNELS)
	.WORD.	IO.MOD,000,006	;(COMMUNICATIONS) SETMODE FUNCTION FAMILY
	.WORD.	IO.HDX,010,006	;(COMMUNICATIONS) SET UNIT HALF DUPLEX
	.WORD.	IO.FDX,020,006	;(COMMUNICATIONS) SET UNIT FULL DUPLEX
	.WORD.	IO.SYN,040,006	;(COMMUNICATIONS) SPECIFY SYNC CHARACTER
	.WORD.	IO.RTC,000,007	;READ CHANNEL - TIME BASED
	.WORD.	IO.RWD,000,005	;REWIND (MAGTAPE, DECTAPE)
	.WORD.	IO.SPB,020,005	;MAGTAPE, SPACE "N" BLOCKS
	.WORD.	IO.SPF,040,005	;MAGTAPE, SPACE "N" EOF MARKS
	.WORD.	IO.EOF,000,006	;MAGTAPE, WRITE EOF
	.WORD.	IO.STC,100,005	;MAGTAPE, SET CHARACTERISTIC
	.WORD.	IO.SEC,120,005	;MAGTAPE, SENSE CHARACTERISTIC
	.WORD.	IO.RWU,140,005	;REWIND AND UNLOAD (MAGTAPE, DECTAPE)
	.WORD.	IO.SMO,160,005	;MAGTAPE, MOUNT & SET CHARACTERISTICS
	.WORD.	IO.SAO,000,010	;UDC SINGLE CHANNEL ANALOG OUTPUT
	.WORD.	IO.SSO,000,011	;UDC SINGLE SHOT, SINGLE POINT
	.WORD.	IO.MSO,000,012	;UDC SINGLE SHOT, MULTI-POINT
	.WORD.	IO.SLO,000,013	;UDC LATCHING, SINGLE POINT
	.WORD.	IO.MLO,000,014	;UDC LATCHING, MULTI-POINT
	.WORD.	IO.LED,000,024	;LPS11 WRITE LED DISPLAY LIGHTS
	.WORD.	IO.SDO,000,025	;LPS11 WRITE DIGITAL OUTPUT REGISTER
	.WORD.	IO.SDI,000,026	;LPS11 READ DIGITAL INPUT REGISTER
	.WORD.	IO.SCS,000,026	;UDC CONTACT SENSE, SINGLE POINT
	.WORD.	IO.REL,000,027	;LPS11 WRITE RELAY
	.WORD.	IO.MCS,000,027	;UDC CONTACT SENSE, MULTI-POINT
	.WORD.	IO.ADS,000,030	;LPS11 SYNCHRONOUS A/D SAMPLING
	.WORD.	IO.CCI,000,030	;UDC CONTACT INT - CONNECT
	.WORD.	IO.MDI,000,031	;LPS11 SYNCHRONOUS DIGITAL INPUT
	.WORD.	IO.DCI,000,031	;UDC CONTACT INT - DISCONNECT
	.WORD.	IO.XMT,000,031	;(COMMUNICATIONS) TRANSMIT SPECIFIED BLOCK WITH ACK
	.WORD.	IO.XNA,010,031	;(COMMUNICATIONS) TRANSMIT WITHOUT ACK
	.WORD.	IO.HIS,000,032	;LPS11 SYNCHRONOUS HISTOGRAM SAMPLING
	.WORD.	IO.RCI,000,032	;UDC CONTACT INT - READ
	.WORD.	IO.RCV,000,032	;(COMMUNICATIONS) RECEIVE DATA IN BUFFER SPECIFIED
	.WORD.	IO.MDO,000,033	;LPS11 SYNCHRONOUS DIGITAL OUTPUT
	.WORD.	IO.CTI,000,033	;UDC TIMER - CONNECT
	.WORD.	IO.CON,000,033	;(COMMUNICATIONS) COMMUNICATIONS CONNECT FUNCTION
	.WORD.	IO.DTI,000,034	;UDC TIMER - DISCONNECT
	.WORD.	IO.DIS,000,034	;(COMMUNICATIONS) COMMUNICATIONS DISCONNECT FUNCTION
	.WORD.	IO.MDA,000,034	;LPS11 SYNCHRONOUS D/A OUTPUT
	.WORD.	IO.RTI,000,035	;UDC TIMER - READ
	.WORD.	IO.CTL,000,035	;(COMMUNICATIONS) NETWORK CONTROL FUNCTION
	.WORD.	IO.STP,000,035	;LPS11 STOP IN PROGRESS FUNCTION
	.WORD.	IO.ITI,000,036	;UDC TIMER - INITIALIZE
	.WORD.	IO.SHT,010,005	;SET HORIZONTAL TAB POSITIONS
	.WORD.	IO.SST,030,005	;SET SPECIAL TERMINATOR CHARACTERS
	.WORD.	IO.SEM,040,005	;SET TERMINAL MODE (CHARACTERISTICS)
	.WORD.	IO.SNM,050,005	;SENSE TERMINAL MODE
	.WORD.	IO.CCT,060,005	;CONNECT TO REMOTE TERMINAL (AUTO DIALOUT)
	.WORD.	IO.DCT,070,005	;DISCONNECT FROM REMOTE TERMINAL (HANGUP)
	.WORD.	IO.ESA,100,005	;ENABLE STATUS AST
;
;
	.MACRO	SPCIO$	A
	.ENDM	SPCIO$
	.ENDM	SPCIO$
;
; HANDLER ERROR CODES RETURNED IN I/O STATUS BLOCK ARE DEFINED THROUGH THIS
; MACRO WHICH THEN CONDITIONALLY INVOKES THE MESSAGE GENERATING MACRO
; FOR THE QIOSYM.MSG FILE
;
	.MACRO	.IOER.	SYM,LO,MSG
	DEFIN$	SYM,LO
	.IF	GT,$$MSG
	.MCALL	.IOMG.
	.IOMG.	SYM,LO,<MSG>
	.ENDC
	.ENDM	.IOER.
;
; QI/O ERROR CODES ARE DEFINED THOUGH THIS MACRO WHICH THEN INVOKES THE
; ERROR MESSAGE GENERATING MACRO, ERROR CODES -129 THROUGH -256
; ARE USED IN THE QIOSYM.MSG FILE
;
	.MACRO	.QIOE.	SYM,LO,MSG
	DEFIN$	SYM,LO
	.IF	GT,$$MSG
	.MCALL	.IOMG.
	.IOMG.	SYM,<LO-128.>,<MSG>
	.ENDC
	.ENDM	.QIOE.
;
; CONDITIONALLY GENERATE DATA FOR WRITING A MESSAGE FILE FOR MO
;
	.MACRO	.IOMG.	SYM,LO,MSG
	.WORD	-<LO>
	.ASCIZ	^MSG^
	.EVEN
	.IIF	LT,<$$$MAX+<LO>>,$$$MAX=-<LO>
	.ENDM	.IOMG.
;
; DEFINE THE SYMBOL SYM WHERE LO IS IS THE LOW ORDER BYTE, HI IS THE HIGH BYTE
;
	.MACRO	.WORD.	SYM,LO,HI
	DEFIN$	SYM,<HI*400+LO>
	.ENDM	.WORD.
	.TITLE	RFCSMC - RELATIVE FILES MACROS
; ALTERED FRIDAY 14-SEP-73 11:50
	.IDENT	/0102/
;                             COPYRIGHT (C) 1973, 1978 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 THERE-
;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;       THE INFORMATION CONTAINED 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 SUPPILED BY DIGITAL.
;
; PETER H. LIPMAN 5-JULY-73
;
; SET RELATIVE FILE RECORD SECTION OF RFDB - ASSEMBLY TIME
	.MACRO	RFRC$A	BTSZ,BTVL,LRCNM,HRCNM
	.MCALL	RFOF$L,CBYTE$,CWORD$
	RFOF$L
	CWORD$	<BTSZ>,R.BTSZ
	CBYTE$	<BTVL>,R.BTVL
	CWORD$	<LRCNM>,R.RCNM+2
	CWORD$	<HRCNM>,R.RCNM
	.ENDM	RFRC$A
;
;
; SET RELATIVE FILE RECORD SECTION OF RFDB AT RUN TIME
	.MACRO	RFRC$R	FDB,BTSZ,BTVL,LRCNM,HRCNM
	.MCALL	LDFDB$,CMOV$W,CMOV$B
	LDFDB$	FDB
	CMOV$W	BTSZ,R.BTSZ
	CMOV$B	BTVL,R.BTVL
	CMOV$W	LRCNM,R.RCNM+2
	CMOV$W	HRCNM,R.RCNM
	.ENDM	RFRC$R
;
;
; DEFINE RFDB, ALLOCATES SPACE, SET BASE FOR ASSEMBLY TIME INIT
	.MACRO	RFDDF$
	.MCALL	RFOFF$,DEF$L
	.IF	NDF,S.RFD
	RFOFF$	DEF$N
	DEF$L	S.RFD
	.ENDC
	...PC1=.
	.BLKB	S.RFD
	.ENDM	RFDDF$
;
;
; DEFINE RELATIVE FILE RECORD OFFSETS LOCALLY
	.MACRO	RFOF$L
	.MCALL	RFOFF$
	RFOFF$	DEF$L
	.ENDM	RFOF$L
; RELATIVE FILE DESCRIPTOR BIT DEFINITIONS
	.MACRO	RFDBT$	GLOBL
	.MCALL	DEFIN$
	...GBL=0
	.IIF	IDN,<GLOBL>,<DEF$G>,	...GBL=1
;
; RELATIVE FILE FLAGS BYTE
	DEFIN$	RF.WRT,1	;SET IF BIT TABLE REC BUFFER DIRTY
	DEFIN$	RF.EXT,2	;SET IF EXTEND IS ALLOWED
	DEFIN$	RF.BEX,4	;SET IF EXTEND ATTEMPTED WHEN RESTRICTED
;
; RELATIVE FILE VALUE BYTE
	DEFIN$	RB.NEW,1	;NEW BIT VALUE TO SET
	DEFIN$	RB.NCH,2	;1 IF NOT CHANGING VALUE
	DEFIN$	RB.VAL,4	;BIT VALUE READ
	.MACRO	RFDBT$	ARG
	.ENDM	RFDBT$
	.ENDM	RFDBT$
;
;
; DEFINE OFFSETS FOR THE RELATIVE FILE EXTENSION OF THE FDB
	.MACRO	RFOFF$	OFFSET
	.MCALL	OFFSET,DEF$I,FDBSZ$
	FDBSZ$
	DEF$I	S.FDB
;
; RELATIVE FILE RECORD SECTION
	OFFSET	R.RCNM,4	;RELATIVE RECORD NUMBER
	OFFSET	R.CLSZ,4	;CLUSTER SIZE
	OFFSET	R.FLAG,1	;FLAGS BYTE
	OFFSET	R.BTVL,1	;VALUE BYTE
	OFFSET	R.BTSZ,2	;BIT TABLE RECORD SIZE
	OFFSET	R.BTBF,2	;BIT TABLE RECORD BUFFER
	OFFSET	R.BTN,2		;BIT TABLE NUMBER
	OFFSET	R.BTRC,2	;BIT TABLE RECORD NUMBER
	OFFSET	S.RFD		;SIZE OF RFDB
;
	.IIF	IDN,<DEF$N>,<OFFSET>,	.MEXIT
	.MACRO	RFOFF$	ARG
	.ENDM	RFOFF$
	.ENDM	RFOFF$
;  OPEN FILE FOR READING

	.MACRO	ROPN$R FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	ROPN$
	ROPN$	FDB,#FO.RD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	ROPN$R

; OPEN FILE FOR WRITING
	.MACRO	ROPN$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	ROPN$
	ROPN$	FDB,#FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	ROPN$W

; OPEN FILE FOR MODIFY
	.MACRO	ROPN$M FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	ROPN$
	ROPN$	FDB,#FO.MFY,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	ROPN$M

; OPEN FILE FOR UPDATE
	.MACRO	ROPN$U FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	ROPN$
	ROPN$	FDB,#FO.UPD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	ROPN$U

; OPEN FILE FOR APPEND
	.MACRO	ROPN$A FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	ROPN$
	ROPN$	FDB,#FO.APD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	ROPN$A

; CLOSE THE FILE

	.MACRO	RCLOS$ FDB,ERR
	.MCALL	LDFDB$,ERR$
	LDFDB$	FDB
	JSR	PC,.RCLOS
	ERR$	ERR
	.ENDM	RCLOS$
;  OPEN FILE FOR READING - SHARED

	.MACRO	ROPS$R FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	ROPN$
	ROPN$	FDB,#FA.SHR!FO.RD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	ROPS$R

; OPEN FILE FOR WRITING - SHARED
	.MACRO	ROPS$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	ROPN$
	ROPN$	FDB,#FA.SHR!FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	ROPS$W

; OPEN FILE FOR MODIFY - SHARED
	.MACRO	ROPS$M FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	ROPN$
	ROPN$	FDB,#FA.SHR!FO.MFY,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	ROPS$M

; OPEN FILE FOR UPDATE - SHARED
	.MACRO	ROPS$U FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	ROPN$
	ROPN$	FDB,#FA.SHR!FO.UPD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	ROPS$U

; OPEN FILE FOR APPEND - SHARED
	.MACRO	ROPS$A FDB,LUN,FNPT,RACC,URBA,URBS,ERR
	.MCALL	ROPN$
	ROPN$	FDB,#FA.SHR!FO.APD,LUN,FNPT,,RACC,URBA,URBS,ERR
	.ENDM	ROPS$A
; OPEN FILE
	.MACRO	ROPN$ FDB,FACC,LUN,FNPT,DFNB,RACC,URBA,URBS,ERR
	.MCALL	FDOP$R,FDRC$R,ERR$,CMOV$B
	FDOP$R	FDB,LUN,FNPT,DFNB,FACC
	FDRC$R	,RACC,URBA,URBS
	.GLOBL	.ROPEN
	JSR	PC,.ROPEN
	ERR$	ERR
	.ENDM	ROPN$
;
; RELATIVE FILE GET
	.MACRO	RGET$	FDB,INADR,MAXCNT,LRCNM,HRCNM,ERR
	.MCALL	LDFDB$,CMOV$W,ERR$
	LDFDB$	FDB
	CMOV$W	INADR,F.URBD+2
	CMOV$W	MAXCNT,F.URBD
	CMOV$W	LRCNM,R.RCNM+2
	CMOV$W	HRCNM,R.RCNM
	JSR	PC,.RGET
	ERR$	ERR
	.ENDM	RGET$
;
; RELATIVE FILE PUT
	.MACRO	RPUT$	FDB,OUTADR,OUTCNT,LRCNM,HRCNM,ERR
	.MCALL	LDFDB$,CMOV$W,ERR$
	LDFDB$	FDB
	CMOV$W	OUTADR,F.NRBD+2
	CMOV$W	OUTCNT,F.NRBD
	CMOV$W	LRCNM,R.RCNM+2
	CMOV$W	HRCNM,R.RCNM
	JSR	PC,.RPUT
	ERR$	ERR
	.ENDM	RPUT$
;
; RELATIVE FILE REPORT EXISTENCE OF RECORD
	.MACRO	RPORT$	FDB,LRCNM,HRCNM,ERR
	.MCALL	RPRTC$
	RPRTC$	<FDB>,#-1,<LRCNM>,<HRCNM>,<ERR>
	.ENDM	RPORT$
;
; REPORT AND OPTIONALLY CHANGE EXISTENCE OF RECORD
	.MACRO	RPRTC$	FDB,CHGVAL,LRCNM,HRCNM,ERR
	.MCALL	LDFDB$,CMOV$W,CMOV$B,ERR$
	LDFDB$	FDB
	CMOV$B	CHGVAL,R.BTVL
	CMOV$W	LRCNM,R.RCNM+2
	CMOV$W	HRCNM,R.RCNM
	JSR	PC,.RPRTC
	ERR$	ERR
	.ENDM	RPRTC$
;
;
; FIND THE NEXT EXISTING RECORD
	.MACRO	RFIND$	FDB,LRCNM,HRCNM,ERR
	.MCALL	LDFDB$,CMOV$W,ERR$
	LDFDB$	FDB
	CMOV$W	LRCNM,R.RCNM+2
	CMOV$W	HRCNM,R.RCNM
	JSR	PC,.RFIND
	ERR$	ERR
	.ENDM	RFIND$
;                             COPYRIGHT (C) 1972, 1978 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 THERE-
;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;       THE INFORMATION CONTAINED 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 SUPPILED BY DIGITAL.
;
;
;
;
; THIS FILE CONTAINS THE MACRO DEFINITIONS FOR THE RSX-11D SYSTEM
; DIRECTIVES.  THEY WERE WRITTEN BY CLARK A. D'ELIA.
;
;
;
; DECEMBER 1972
;
; VERSION V01-13
;
; EDIT E01 PERFORMED 12-JAN-73
; EDIT E02 PERFORMED 22-JAN-73
; EDIT E03 PERFORMED 13-FEB-73
; EDIT E04 PERFORMED 22-FEB-73
; EDIT E05 PERFORMED 2-MAR-73
; EDIT E06 PERFORMED 8-MAR-73
; EDIT E07 PERFORMED 16-APR-73
; EDIT E08 PERFORMED  29-APR-73
; EDIT E09 PERFORMED  16-MAY-73
; EDIT E10 PERFORMED  28-OCT-73
; EDIT E11 PERFORMED 11-NOV-73
; EDIT E12 PERFORMED 10-JAN-74
; EDIT E13 PERFORMED 1-NOV-74
;
;

 
;
; WITH EDIT 'E05' CHANGES WERE MADE TO ALL OF THE MACROS USING
; UIC'S.  THE ORDERING OF THE TWO BYTES OF THE UIC WAS REVERSED.
;
 
;
; WITH EDIT 'E06' THE SYMBOLIC OFFSETS FOR UIC'S WERE CORRECTED.
;
 

; THE ".INH" MACRO TO INHIBIT INTERRUPTS WAS ADDED WITH EDIT 'E06'.
	.MACRO	.INH
	MOV	@#177776,-(SP)
	BIS	#340,@#177776
	.ENDM	.INH
 
 
; THE ".ENB" MACRO TO ENABLE INTERRUPTS WAS ADDED WITH EDIT 'E06'.
	.MACRO	.ENB
	MOV	(SP)+,@#177776
	.ENDM	.ENB
 
 
; THE ".PARAM" MACRO WAS ADDED WITH EDIT 'E07'.  IT IS USED BY
; PROGRAMS ORIGINALLY WRITTEN FOR DOS-11.
	.MACRO	.PARAM
	.ENDM	.PARAM


;+
;		'ALUN$C'
;
; THE ALUN$C MACRO GENERATES A DPB FOR THE "ASSIGN LUN" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED
; PSECT.
;
; MACRO CALL:	ALUN$C	LUN,DEVNAM,DEVNUM,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "ASSIGN LUN"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE ARGUMENTS
; THROUGH 'DEVNUM' ARE THE DPB PARAMETERS AS DESCRIBED FOR THE
; ALUN$ MACRO.  THE MACRO THEN GENERATES A MONITOR TRAP
; IN THE ORIGINAL PROGRAM CONTROL SECTION AS SPECIFIED BY
; 'PSCT'.  THE ARGUMENT 'ERR' IS AS DESCRIBED FOR THE DIR$
; MACRO.  FOR AN EXPLANATION OF SYMBOLIC OFFSETS, SEE THE
; ALUN$ MACRO.
;
;-
	.MACRO	ALUN$C	LUN,DA,DU,CS,ERR
	.MCALL	ALUN$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	ALUN$	LUN,DA,DU
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	ALUN$C
 
; THE "ALUN$S" AND "ALUN$" MACROS WERE ALTERED TO REFLECT A CHANGE
; IN THE SPECIFICATION OF THE "ASSIGN LUN" DIRECTIVE WITH EDIT
; 'E11'.
 
;+
;		'ALUN$S'
;
; THE ALUN$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "ASSIGN LUN" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	ALUN$S	LUN,DEVNAM,DEVNUM,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB
; FOR THE "ASSIGN LUN" DIRECTIVE ON THE STACK.  THE ARGUMENTS
; THROUGH 'DEVNUM' MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND
; THEY MUST SPECIFY THE DPB PARAMETERS LISTED IN THE ALUN$
; MACRO.  THE ARGUMENT 'ERR' IS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	ALUN$S	LUN,DA,DU,ERR
	.MCALL	RVP$,DIR$,NBL$,MOV$
	NBL$	<DA,DU>
	.IF EQ	$$$ARG
	MOV$	LUN
	MOV	(PC)+,-(SP)
	.BYTE	7.,2
	.IFF
	RVP$	LUN,DA,DU
	MOV	(PC)+,-(SP)
	.BYTE	7.,4
	.ENDC
	DIR$	,ERR
	.ENDM	ALUN$S
 
; THE 'ALUN$' MACRO WAS MODIFIED WITH EDIT 'E04' TO INSURE THAT
; TWO ASCII CHARACTERS WERE PLACED IN THE DPB AT ALL TIMES.
 
;+
;		'ALUN$'
;
; THE ALUN$ MACRO GENERATES A DPB FOR THE "ASSIGN LUN"
; DIRECTIVE.
;
; MACRO CALL:	ALUN$	LUN,DEVNAM,DEVNUM
;
; DESCRIPTION: THIS MACRO CREATES A DPB FOR THE "ASSIGN LUN"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	LUN=LOGICAL UNIT NUMBER,
;	DEVNAM=PHYSICAL DEVICE NAME (TWO CHARACTERS),
;	DEVNUM=PHYSICAL DEVICE UNIT NUMBER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	A.LULU-(LENGTH 2 BYTES) LOGICAL UNIT NUMBER,
;	A.LUNA-(2) PHYSICAL DEVICE NAME,
;	A.LUNU-(2) PHYSICAL DEVICE UNIT NUMBER.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED,
; THE DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE
; GLOBALLY DEFINED.
;
;-

	.MACRO	ALUN$	LUN,DA,DU
	.MCALL	OFF$,NBL$
	.IF NDF	$$$GLB
	NBL$	<DA,DU>
	.IF EQ	$$$ARG
	.BYTE	7,2
	.IFF
	.BYTE	7,4
	.IFTF
	.WORD	LUN
	.IFF
	.NLIST
$$$T1=0
	.LIST
	.IRPC	X,<DA>
	.IF LT	$$$T1-2
	.ASCII	/X/
	.NLIST
$$$T1=$$$T1+1
	.LIST
	.ENDC
	.ENDM
	.IIF EQ	$$$T1,	.ASCII	/  /
	.IIF EQ	$$$T1-1,	.ASCII	/ /
	.WORD	DU
	.ENDC
	.ENDC
	.NLIST
	.IRP	X,<,<A.LULU,2>,<A.LUNA,2>,<A.LUNU,2>>
	OFF$	X
	.ENDM
	.LIST
	.ENDM	ALUN$
;+
;		'CLEF$C'
;
; THE CLEF$C MACRO GENERATES A DPB FOR THE "CLEAR EVENT FLAG"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE
; USER SPECIFIED PROGRAM PSECT.
;
; MACRO CALL:	CLEF$C	EFN,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE
; "CLEAR EVENT FLAG" DIRECTIVE IN THE CONTROL SECTION
; NAMED '$DPB$$'.  THE DPB PARAMETERS ARE DESCRIBED
; IN THE CLEF$ MACRO.  THIS MACRO THEN GENERATES
; A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS,
; 'ERR', IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION
; OF SYMBOLIC OFFSETS IS CONTROLLED BY THE CLEF$
; MACRO.
;
;-
	.MACRO	CLEF$C	EFN,CS,ERR
	.MCALL	CLEF$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	CLEF$	EFN
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	CLEF$C

;+
;		'CLEF$S'
;
; THE CLEF$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "CLEAR EVENT FLAG" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	CLEF$S	EFN,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR 
; THE "CLEAR EVENT FLAG" DIRECTIVE ON THE STACK.  THE DPB
; ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS,
; AND THEY MUST SPECIFY THE INFORMATION DESCRIBED IN
; THE CLEF$ MACRO.  THIS MACRO ALSO GENERATES A MONITOR
; TRAP, USING THE ERROR SERVICE ADDRESS,'ERR',AS DESCRIBED
; IN THE DIR$ MACRO.
;
;-
	.MACRO	CLEF$S	EFN,ERR
	.MCALL	MOV$,DIR$
	MOV$	EFN
	MOV	(PC)+,-(SP)
	.BYTE	31.,2
	DIR$	,ERR
	.ENDM	CLEF$S
;+
;		'CLEF$'
;
; THE CLEF$ MACRO GENERATES A DPB FOR THE "CLEAR EVENT FLAG"
; DIRECTIVE.
;
; MACRO CALL:	CLEF$	EFN
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE
; "CLEAR EVENT FLAG" DIRECTIVE.  THE ARGUMENTS ARE
; ASSUMED TO HAVE THE FOLLOWING MEANING:
;
;	EFN=EVENT FLAG NUMBER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR
; ASSIGNED VALUES EQUAL TO THE BYTE OFFSET FROM THE
; START OF THE DPB TO THE RESPECTIVE DPB ELEMENTS:
;
;	C.LEEF-(LENGTH 2 BYTES) EVENT FLAG NUMBER.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB'
; DEFINED, THE DPB IS NOT GENERATED, AND THE
; SYMBOLIC OFFSETS ARE DEFINED GLOBALLY.
;
;-
	.MACRO	CLEF$	EFN
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	31.,2
	.WORD	EFN
	.ENDC
	.NLIST
	OFF$
	OFF$	C.LEEF,2
	.LIST
	.ENDM	CLEF$

;+
;		'CMKT$C'
;
; THE CMKT$C MACRO GENERATES A DPB FOR THE "CANCEL MARK-TIME
; REQUESTS" DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP
; IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	CMKT$C	EFN,AST,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "CANCEL MARK-TIME
; REQUESTS" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE
; DPB PARAMETERS ARE DESCRIBED IN THE CMKT$ MACRO.  THEN THE
; MACRO GENERATES A MONITOR CALL IN THE ORIGINAL PROGRAM
; CONTROL SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS,
; 'ERR', IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF
; SYMBOLIC OFFSETS IS CONTROLLED BY THE CMKT$ MACRO.
;
;-

	.MACRO	CMKT$C	EFN,AST,PSCT,ERR
	.MCALL	CMKT$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	CMKT$	EFN,AST
	.IFT
	.PSECT	PSCT
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	CMKT$C
;+
;		'CMKT$S'
;
; THE CMKT$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "CANCEL
; MARK-TIME REQUESTS" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	CMKT$S	EFN,AST,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "CANCEL MARK-TIME REQUESTS" DIRECTIVE ON THE STACK.  THE DPB
; ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY
; MUST SPECIFY THE INFORMATION DESCRIBED IN THE CMKT$ MACRO.
; THE MACRO ALSO GENERATES A MONITOR TRAP.  THE ERROR SERVICE
; ADDRESS, 'ERR', IS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	CMKT$S	EFN,AST,ERR
	.MCALL	NBL$,MOV$,DIR$
	NBL$	<EFN,AST>
	.IF EQ	$$$ARG
	MOV	(PC)+,-(SP)
	.BYTE	27.,1
	.IFF
	MOV$	AST
	MOV$	EFN
	MOV	(PC)+,-(SP)
	.BYTE	27.,3
	.ENDC
	DIR$	,ERR
	.ENDM	CMKT$S
;+
;		'CMKT$'
;
; THE CMKT$ MACRO GENERATES A DPB FOR THE "CANCEL MARK-TIME REQUESTS"
; DIRECTIVE.
;
; MACRO CALL:	CMKT$	EFN,AST
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "CANCEL MARK-TIME
; REQUESTS" DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	EFN=EVENT FLAG NUMBER.
;	AST=AST SERVICE ROUTINE ENTRY ADDRESS.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED VALUES
; EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO THE
; RESPECTIVE DPB ELEMENTS:
;
;	C.MKEF-(LENGTH 2 BYTES) EVENT FLAG NUMBER,
;	C.MKAE-(2) AST SERVICE ROUTINE ENTRY ADDRESS.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE DPB
; IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE GLOBALLY DEFINED.
;
;-
	.MACRO	CMKT$	EFN,AST
	.MCALL	NBL$,OFF$
	.IF NDF	$$$GLB
	NBL$	<EFN,AST>
	.IF EQ	$$$ARG
	.BYTE	27.,1
	.IFF
	.BYTE	27.,3
	.WORD	EFN
	.WORD	AST
	.ENDC
	.ENDC
	.NLIST
	.IRP	X,<,<C.MKEF,2>,<C.MKAE,2>>
	OFF$	X
	.ENDM
	.LIST
	.ENDM	CMKT$

;+
;		'DECL$C'
;
; THE DECL$C MACRO GENERATES A DPB FOR THE "DECLARE SIGNIFICANT EVENT"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER
; SPECIFIED PROGRAM PSECT.
;
; MACRO CALL:	DECL$C	EFN,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE
; "DECLARE SIGNIFICANT EVENT" DIRECTIVE IN THE CONTROL SECTION
; NAMED '$DPB$$'.  THE DPB PARAMETERS ARE DESCRIBED
; IN THE DECL$ MACRO.  THIS MACRO THEN GENERATES
; A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS,
; 'ERR', IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION
; OF SYMBOLIC OFFSETS IS CONTROLLED BY THE DECL$
; MACRO.
;
;-
	.MACRO	DECL$C	EFN,CS,ERR
	.MCALL	DECL$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	DECL$	EFN
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	DECL$C
;+
;		'DECL$S'
;
; THE DECL$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "DECLARE SIGNIFICANT EVENT" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	DECL$S	EFN,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "DECLARE SIGNIFICANT EVENT' DIRECTIVE ON THE STACK.  THE DPB
; ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS,
; AND THEY MUST SPECIFY THE INFORMATION DESCRIBED IN
; THE DECL$ MACRO.  THIS MACRO ALSO GENERATES A MONITOR
; TRAP, USING THE ERROR SERVICE ADDRESS, 'ERR', AS DESCRIBED
; IN THE DIR$ MACRO.
;
;-
	.MACRO	DECL$S	EFN,ERR
	.MCALL	MOV$,DIR$
	.IF B	<EFN>
	MOV	(PC)+,-(SP)
	.BYTE	35.,1
	.IFF
	MOV$	EFN
	MOV	(PC)+,-(SP)
	.BYTE	35.,2
	.ENDC
	DIR$	,ERR
	.ENDM	DECL$S

;+
;		'DECL$'
;
; THE DECL$ MACRO GENERATES A DPB FOR THE "DECLARE SIGNIFICANT EVENT"
; DIRECTIVE.
;
; MACRO CALL:	DECL$	EFN
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE
; "DECLARE SIGNIFICANT EVENT" DIRECTIVE.  THE ARGUMENTS
; ARE ASSUMED TO HAVE THE FOLLOWING MEANINGS:
;
;	EFN=EVENT FLAG NUMBER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR
; ASSIGNED VALUES EQUAL TO THE BYTE OFFSET FROM THE
; START OF THE DPB TO THE RESPECTIVE DPB ELEMENTS:
;
;	D.CLEF-(LENGTH 2 BYTES) EVENT FLAG NUMBER.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB'
; DEFINED, THE DPB IS NOT GENERATED, AND THE
; SYMBOLIC OFFSETS ARE DEFINED GLOBALLY.
;
;-
	.MACRO	DECL$	EFN
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.IF B	<EFN>
	.BYTE	35.,1
	.IFF
	.BYTE	35.,2
	.WORD	EFN
	.ENDC
	.ENDC
	.NLIST
	OFF$
	OFF$	D.CLEF,2
	.LIST
	.ENDM	DECL$


;+
;			'DSCP$C'
;
; THE DSCP$C MACRO GENERATES A DPB FOR THE "DISABLE CHECKPOINTING"
;+
;			'EXIF$C'
;
; THE EXIF$C MACRO GENERATES A DPB FOR THE "EXIT IF"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN 
; THE USER SPECIFIED PROGRAM PSECT.
;
; MACRO CALL:		EXIF$C	EFN,PSCT,ERR
;
; DESCRIPTION:  THIS MACRO GENERATES A DPB FOR THE
; "EXIT IF" DIRECTIVE IN THE CONTROL SECTION
; NAMED '$DPB$$'.  THE DPB PARAMETERS ARE DESCRIBED
; IN THE EXIF$ MACRO.  THIS MACRO THEN GENERATES
; A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS,
; 'ERR', IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION
; OF SYMBOLIC OFFSETS IS CONTROLLED BY THE EXIF$
; MACRO.
;
;-
	.MACRO	EXIF$C	EFN,CS,ERR
	.MCALL	EXIF$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	EXIF$	EFN
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	EXIF$C
;+
;			'EXIF$S'
;
; THE EXIF$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "EXIT IF" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:		EXIF$S	EFN,ERR
;
; DESCRIPTION:  THIS MACRO GENERATES THE CODE TO PUSH A DPB 
; FOR THE "EXIT IF" DIRECTIVE ON THE STACK.  THE DPB
; ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS,
; AND THEY MUST SPECIFY THE INFORMATION DESCRIBED IN
; THE EXIF$ MACRO.  THIS MACRO ALSO GENERATES A MONITOR
; TRAP, USING THE ERROR SERVICE ADDRESS, 'ERR', AS DESCRIBED
; IN THE DIR$ MACRO.
;
;-
	.MACRO	EXIF$S	EFN,ERR
	.MCALL	MOV$,DIR$
	MOV$	EFN
	MOV	(PC)+,-(SP)
	.BYTE	53.,2
	DIR$	,ERR
	.ENDM	EXIF$S
;+
;			'EXIF$'
;
; THE EXIF$ MACRO GENERATES A DPB FOR THE "EXIT IF"
; DIRECTIVE.
;
; MACRO CALL:		EXIF$	EFN
;
; DESCRIPTION:  THIS MACRO GENERATES A DPB FOR THE
; "EXIT IF" DIRECTIVE.  THE ARGUMENTS ARE ASSUMED
; TO HAVE THE FOLLOWING MEANINGS:
;
;	EFN=EVENT FLAG NUMBER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR
; ASSIGNED VALUES EQUAL TO THE BYTE OFFSET FROM THE
; START OF THE DPB TO THE RESPECTIVE DPB ELEMENTS:
;
;	E.XFEF-(LENGTH 2 BYTES) EVENT FLAG NUMBER.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB'
; DEFINED, THE DPB IS NOT GENERATED, AND THE
; SYMBOLIC OFFSETS ARE DEFINED GLOBALLY.
;
;-
	.MACRO	EXIF$	EFN
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	53.,2
	.WORD	EFN
	.ENDC
	.NLIST
	OFF$
	OFF$	E.XFEF,2
	.LIST
	.ENDM	EXIF$
;+
;			'EXIT$C'
;
; THE EXIT$C MACRO GENERATES A DPB FOR THE "TASK EXIT" DIRECTIVE IN A
; SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:		EXIT$C	PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A ONE-WORD DPB FOR THE "TASK EXIT"
; DIRECTIVE IN THE PSECT NAMED '$DPB$$'.  THEN IN THE ORIGINAL PROGRAM
; PSECT NAMED IN 'PSCT', A MONITOR TRAP IS GENERATED, USING THE ERROR
; SERVICE ADDRESS, 'ERR', DESCRIBED IN THE DIR$ MACRO.  AS WITH THE
; EXIT$ MACRO, SYMBOLIC OFFSETS ARE NOT CREATED.
;
;-
	.MACRO	EXIT$C	CS,ERR
	.MCALL	EXIT$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	EXIT$
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	EXIT$C
;+
;			'EXIT$S'
;
; THE EXIT$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "TASK EXIT"
; DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:		EXIT$S ERR
;
; DESCRIPTION:  THIS MACRO GENERATES THE CODE TO PUSH A ONE-WORD DPB FOR
; THE "TASK EXIT" DIRECTIVE ON THE STACK.  THEN A MONITOR TRAP IS GENERATED
; USING THE ERROR SERVICE ADDRESS, 'ERR', AS DESCRIBED IN THE EXIT$ MACRO.
;
;-
	.MACRO	EXIT$S ERR
	.MCALL	DIR$
	MOV	(PC)+,-(SP)
	.BYTE	51.,1
	DIR$	,ERR
	.ENDM	EXIT$S
;+
;			'EXIT$'
;
; THE EXIT$ MACRO GENERATES A DPB FOR THE "TASK EXIT" DIRECTIVE.
;
; MACRO CALL:		EXIT$
;
; DESCRIPTION:  THIS MACRO GENERATES A ONE-WORD DPB FOR THE "TASK EXIT"
; DIRECTIVE.  THE MACRO REQUIRES NO ARGUMENTS AND DOES NOT CREATE SYMBOLIC
; OFFSETS.  IF THE SYMBOL '$$$GLB' IS DEFINED, THIS MACRO CREATES NOTHING.
;
;-
	.MACRO	EXIT$
	.IF NDF	$$$GLB
	.BYTE	51.,1
	.ENDC
	.ENDM	EXIT$
;+
;			'FIX$C'
;
; THE FIX$C MACRO GENERATES A DPB FOR THE "FIX-IN-MEMORY"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER
; SPECIFIED PROGRAM PSECT.
;
; MACRO CALL:		FIX$C	TASK,PSCT,ERR
;
; DESCRIPTION:  THIS MACRO GENERATES A DPB FOR THE
; "FIX-IN-MEMORY" DIRECTIVE IN THE CONTROL SECTION
; NAMED '$DPB$$'.  THE DPB PARAMETERS ARE DESCRIBED
; IN THE FIX$ MACRO.  THIS MACRO THEN GENERATES
; A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS,
; 'ERR', IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION
; OF SYMBOLIC OFFSETS IS CONTROLLED BY THE FIX$
; MACRO.
;
;-
	.MACRO	FIX$C	TN,CS,ERR
	.MCALL	FIX$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	FIX$	TN
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	FIX$C
;+
;			'FIX$S'
;
; THE FIX$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "FIX-IN-MEMORY" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:		FIX$S	TSKNAMADR,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "FIX-IN-MEMORY" DIRECTIVE ON THE STACK.  THE DPB
; ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS,
; AND THEY MUST SPECIFY THE INFORMATION DESCRIBED IN 
; THE FIX$ MACRO.  THIS MACRO ALSO GENERATES A MONITOR
; TRAP, USING THE ERROR SERVICE ADDRESS, 'ERR', AS DESCRIBED
; IN THE DIR$ MACRO.
;
;-
	.MACRO	FIX$S	TN,ERR
	.MCALL	RFA$,DIR$
	RFA$	TN
	MOV	(PC)+,-(SP)
	.BYTE	85.,3
	DIR$	,ERR
	.ENDM	FIX$S
;+
;			'FIX$'
;
; THE FIX$ MACRO GENERATES A DPB FOR THE "FIX-IN-MEMORY"
; DIRECTIVE.
;
; MACRO CALL:		FIX$	TASK
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE
; "FIX-IN-MEMORY" DIRECTIVE.  THE ARGUMENTS ARE ASSUMED
; TO HAVE THE FOLLOWING MEANING:
;
;	TASK=TASK NAME.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR
; ASSIGNED VALUES EQUAL TO THE BYTE OFFSET FROM THE
; START OF THE DPB TO THE RESPECTIVE DPB ELEMENTS:
;
;	F.IXTN-(LENGTH 4 BYTES) TASK NAME.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB'
; DEFINED, THE DPB IS NOT GENERATED, AND THE
; SYMBOLIC OFFSETS ARE DEFINED GLOBALLY.
;
;-
	.MACRO	FIX$	TN
	.MCALL	R50$,OFF$
	.IF NDF	$$$GLB
	.BYTE	85.,3
	R50$	TN
	.ENDC
	.NLIST
	OFF$
	OFF$	F.IXTN,4
	.LIST
	.ENDM	FIX$
 
; THE FOLLOWING THREE MACROS FOR THE "GET COMMON BLOCK PARAMETERS"
; DIRECTIVE WERE ADDED WITH EDIT 'E05'.
 
 
; THE FOLLOWING THREE MACROS FOR THE "GET PARTITION PARAMETERS"
; DIRECTIVE WERE ADDED WITH EDIT 'E05'.
 
;+
;		'GPRT$C'
;
;  THE GPRT$C MACRO GENERATES A DPB FOR THE "GET PARTITION PARAMETERS"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER
; SPECIFIED PSECT.
;
; MACRO CALL:	GPRT$C	PRTNAM,BUFADR,PSCT,ERR
;
; DESCRIPTION:	THIS MACRO GENERATES A DPB FOR THE "GET PARTITION
; PARAMETERS" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE
; DPB PARAMETERS ARE DESCRIBED IN THE GPRT$ MACRO.  THIS MACRO THEN
; GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL SECTION
; NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR', IS DESCRIBED IN
; THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC OFFSETS IS CONTROLLED
; BY THE GPRT$ MACRO.
;
;-
	.MACRO	GPRT$C	PRT,BUF,CS,ERR
	.MCALL	GPRT$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	GPRT$	PRT,BUF
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	GPRT$C
;+
;		'GPRT$S'
;
; THE GPRT$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "GET
; PARTITION PARAMETERS" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	GPRT$S	PRTNAMADR,BUFADR,ERR
;
; DESCRIPTION:	THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "GET PARTITION PARAMETERS" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY THE
; INFORMATION DESCRIBED IN THE GPRT$ MACRO.  THIS MACRO ALSO GENERATES
; A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS, 'ERR', AS DESCRIBED
; IN THE DIR$ MACRO.
; THIS MACRO ALSO GENERATES SYMBOLIC OFFSETS RELATIVE TO THE START
; OF THE PARTITION PARAMETERS BUFFER AS DESCRIBED IN THE GPRT$ MACRO.
;
;-
	.MACRO	GPRT$S	PRT,BUF,ERR
	.MCALL	MOV$,RFA$,DIR$,OFF$
	MOV$	BUF
	RFA$	PRT
	MOV	(PC)+,-(SP)
	.BYTE	65.,4
	DIR$	,ERR
	.NLIST
$$$OST=0
	.IRP	X,<<G.PRPB,2>,<G.PRPS,2>,<G.PRFW,2>>
	OFF$	X
	.ENDM
	.LIST
	.ENDM	GPRT$S
;+
;		'GPRT$'
;
; THE GPRT$ MACRO GENERATES A DPB FOR THE "GET PARTITION PARAMETERS"
; DIRECTIVE.
;
; MACRO CALL:	GPRT$	PRTNAM,BUF
;
; DESCRIPTION:	THIS MACRO GENERATES A DPB FOR THE "GET PARTITION
; PARAMETERS" DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE
; FOLLOWING MEANINGS:
;
;	PRTNAM=PARTITION NAME,
;	BUFADR=ADDRESS OF THREE WORD BUFFER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO THE
; RESPECTIVE DPB ELEMENTS:
;
;	G.PRPN-(LENGTH 4 BYTES) PARTITION NAME,
;	G.PRBA-(2) BUFFER ADDRESS.
;
; THE FOLLOWING OFFSETS ARE ASSIGNED RELATIVE TO THE START OF
; THE PARTITION PARAMETERS BUFFER:
;
;	G.PRPB-(2) 1/64 PARTITION BASE ADDRESS,
;	G.PRPS-(2) 1/64 PARTITION SIZE,
;	G.PRFW-(2) PARTITION FLAGS WORD.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	GPRT$	PRT,BUF
	.MCALL	OFF$,R50$
	.IF NDF	$$$GLB
	.BYTE	65.,4
	R50$	PRT
	.WORD	BUF
	.ENDC
	.NLIST
	OFF$
	OFF$	G.PRPN,4
	OFF$	G.PRBA,2
	.IF NDF	G.PRPB
$$$OST=0
	.IRP	X,<<G.PRPB,2>,<G.PRPS,2>,<G.PRFW,2>>
	OFF$	X
	.ENDM
	.ENDC
	.LIST
	.ENDM	GPRT$
 
; THE FOLLOWING THREE MACROS WERE ALTERED TO REFLECT A CHANGE IN THE
; IN THE SPECIFICATION OF THE "GET LUN INFORMATION" DIRECTIVE WITH
; EDIT 'E10'.
 
;+
;			'GLUN$C'
;
; THE GLUN$C MACRO GENERATES A DPB FOR THE "GET LUN INFORMATION"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER
; SPECIFIED PROGRAM PSECT.
;
; MACRO CALL:		GLUN$C	LUN,BUFADR,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE
; "GET LUN INFORMATION" DIRECTIVE IN THE CONTROL SECTION
; NAMED '$DPB$$'.  THE DPB PARAMETERS ARE DESCRIBED
; IN THE GLUN$ MACRO.  THIS MACRO THEN GENERATES
; A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS,
; 'ERR', IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION
; OF SYMBOLIC OFFSETS IS CONTROLLED BY THE GLUN$
; MACRO.
;
;-
	.MACRO 	GLUN$C	LUN,BUFA,CS,ERR
	.MCALL	GLUN$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	GLUN$	LUN,BUFA
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	GLUN$C
 
; THE "GLUN$S" MACRO WAS ALTERED TO GENERATE SYMBOLIC OFFSETS
; WITH EDIT 'E10'.
 
;+
;			'GLUN$S'
;
; THE GLUN$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "GET LUN INFORMATION" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:		GLUN$S	LUN,BUFADR,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "GET LUN INFORMATION" DIRECTIVE ON THE STACK.  THE DPB
; ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS,
; AND THEY MUST SPECIFY THE INFORMATION DESCRIBED IN
; THE GLUN$ MACRO.  THIS MACRO ALSO GENERATES A MONITOR
; TRAP, USING THE ERROR SERVICE ADDRESS, 'ERR', AS DESCRIBED
; IN THE DIR$ MACRO.
; THIS MACRO ALSO GENERATES SYMBOLIC OFFSETS RELATIVE TO THE
; INFORMATION BUFFER AS DESCRIBED IN THE GLUN$ MACRO.
;
;-
	.MACRO	GLUN$S	LUN,BUFA,ERR
	.MCALL	MOV$,DIR$,OFF$
	MOV$	BUFA
	MOV$	LUN
	MOV	(PC)+,-(SP)
	.BYTE	5,3
	DIR$	,ERR
	.NLIST
$$$OST=0
	.IRP	X,<<G.LUNA,2>,<G.LUNU,1>,<G.LUFB,1>,<G.LUCW,8.>>
	OFF$	X
	.ENDM
	.LIST
	.ENDM	GLUN$S
 
; THE "GLUN$" MACRO WAS ALTERED TO GENERATE THE SYMBOLIC OFFSETS
; RELATIVE TO THE INFORMATION BUFFER WITH EDIT 'E10'.
;+
;			'GLUN$'
;
; THE GLUN$ MACRO GENERATES A DPB FOR THE "GET LUN INFORMATION"
; DIRECTIVE.
;
; MACRO CALL:		GLUN$	LUN,BUFADR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE
; "GET LUN INFORMATION" DIRECTIVE.  THE ARGUMENTS 
; ARE ASSUMED TO HAVE THE FOLLOWING MEANING:
;
;	LUN=LOGICAL UNIT NUMBER,
;	BUFADR=BUFFER ADDRESS
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR
; ASSIGNED VALUES EQUAL TO THE BYTE OFFSET FROM THE
; START OF THE DPB TO THE RESPECTIVE DPB ELEMENTS:
;
;	G.LULU-(LENGTH 2 BYTES) LOGICAL UNIT NUMBER,
;	G.LUBA-(2) BUFFER ADDRESS.
;
; THE FOLLOWING SYMBOLS ARE ASSIGNED RELATIVE TO THE START OF
; THE LUN INFORMATION BUFFER:
;
;	G.LUNA-(2) DEVICE NAME,
;	G.LUNU-(1) DEVICE UNIT NUMBER,
;	G.LUFB-(1) FLAGS BYTE,
;	G.LUCW-(8) FOUR DEVICE CHARACTERISTIC WORDS.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB'
; DEFINED, THE DPB IS NOT GENERATED, AND THE
; SYMBOLIC OFFSETS ARE DEFINED GLOBALLY.
;
;-
	.MACRO	GLUN$	LUN,BUFA
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	5,3
	.WORD	LUN
	.WORD	BUFA
	.ENDC
	.NLIST
	.IRP	X,<,<G.LULU,2>,<G.LUBA,2>>
	OFF$	X
	.ENDM
	.IF NDF	G.LUNA
$$$OST=0
	.IRP	X,<<G.LUNA,2>,<G.LUNU,1>,<G.LUFB,1>,<G.LUCW,8.>>
	OFF$	X
	.ENDM
	.ENDC
	.LIST
	.ENDM	GLUN$

;+
;		'GMCR$C'
;
; THE GMCR$C MACRO GENERATES A DPB FOR THE "GET MCR COMMAND LINE" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	GMCR$C	PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "GET MCR COMMAND
; LINE" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE GMCR$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE GMCR$ MACRO.
;
;-
	.MACRO	GMCR$C	CS,ERR
	.MCALL	GMCR$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	GMCR$
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	GMCR$C
;+
;		'GMCR$'
;
; THE GMCR$ MACRO GENERATES A DPB FOR THE "GET MCR COMMAND LINE" DIRECTIVE.
;
; MACRO CALL:	GMCR$
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "GET MCR COMMAND LINE"
; DIRECTIVE.
;
; THE FOLLOWING SYMBOL IS LOCALLY DEFINED WITH ITS ASSIGNED
; VALUE EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENT:
;
;	G.MCRB-(LENGTH 80 BYTES) MCR LINE BUFFER
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-

	.MACRO	GMCR$
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	127.,41.
	.BLKW	40.
	.ENDC
	.NLIST
	OFF$
	OFF$	G.MCRB,80.
	.LIST
	.ENDM	GMCR$

; THE FOLLOWING THREE MACROS FOR THE "GET SENSE SWITCHES" DIRECTIVE
; WERE ADDED WITH EDIT 'E03'.

;+
;		'GSSW$C'
;
; THE GSSW$C MACRO GENERATES A DPB FOR THE "GET SENSE SWITCHES" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	GSSW$C	PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A ONE-WORD DPB FOR THE "GET SENSE
; SWITCHES" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  AS WITH
; THE GSSW$ MACRO, NO DPB PARAMETERS ARE REQUIRED, AND NO OFFSETS ARE
; GENERATED.  THE MACRO THEN GENERATES A MONITOR TRAP IN THE ORIGINAL
; PROGRAM CONTROL SECTION AS NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS,
; 'ERR', IS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	GSSW$C	CS,ERR
	.MCALL	GSSW$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	GSSW$
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	GSSW$C
;+
;		'GSSW$S'
;
; THE GSSW$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "GET SENSE
; SWITCHES" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	GSSW$S	ERR
;
; DESCRIPTION:	THIS MACRO GENERATES THE CODE TO PUSH A ONE-WORD DPB FOR
; THE "GET SENSE SWTICHES" DIRECTIVE ON THE STACK.  THEN IT GENERATES A
; MONITOR TRAP USING THE ERROR SERVICE ADDRESS AS DESCRIBED IN THE DIR$
; MACRO.
;
;-
	.MACRO	GSSW$S	ERR
	.MCALL	DIR$
	MOV	(PC)+,-(SP)
	.BYTE	29.,1
	DIR$	,ERR
	.ENDM	GSSW$S
;+
;		'GSSW$'
;
; THE GSSW$ MACRO GENERATES A DPB FOR THE "GET SENSE SWITCHES" DIRECTIVE.
;
; MACRO CALL:	GSSW$
;
; DESCRIPTION:	THIS MACRO GENERATES A ONE-WORD DPB FOR THE "GET SENSE
; SWITCHES" DIRECTIVE.  THE MACRO REQUIRES NO ARGUMENTS AND CREATES NO
; SYMBOLIC OFFSETS.  IF THE SYMBOL '$$$GLB' IS DEFINED,  THIS MACRO DOES
; NOTHING.
;
;-
	.MACRO	GSSW$
	.IF NDF	$$$GLB
	.BYTE	29.,1
	.ENDC
	.ENDM	GSSW$
;+
;		'GTIM$C'
;
; THE GTIM$C MACRO GENERATES A DPB FOR THE "GET TIME PARAMETERS" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	GTIM$C	BUFADR,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "GET TIME PARAMETERS"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE GTIM$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE GTIM$ MACRO.
;
;-
	.MACRO	GTIM$C	BUFA,CS ERR
	.MCALL	GTIM$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	GTIM$	BUFA
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	GTIM$C

; THE "GTIM$S" MACRO WAS ALTERED TO GENERATE SYMBOLIC OFFSETS
; WITH EDIT 'E01'.

;+
;		'GTIM$S'
;
; THE GTIM$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "GET TIME PARAMETERS" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	GTIM$S	BUFADR,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "GET TIME PARAMETERS" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE GTIM$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
; THIS MACRO ALSO GENERATES SYMBOLIC OFFSETS RELATIVE TO THE
; TIME PARAMETERS BUFFER AS DESCRIBED IN THE GTIM$ MACRO.
;
;-
	.MACRO	GTIM$S	BUFA,ERR
	.MCALL	MOV$,DIR$,OFF$
	MOV$	BUFA
	MOV	(PC)+,-(SP)
	.BYTE	59.,2
	DIR$	,ERR
	.NLIST
$$$OST=0
	.IRP	X,<<G.TIYR,2>,<G.TIMO,2>,<G.TIDA,2>,<G.TIHR,2>>
	OFF$	X
	.ENDM
	.IRP	X,<<G.TIMI,2>,<G.TISC,2>,<G.TICT,2>,<G.TICP,2>>
	OFF$	X
	.ENDM
	.LIST
	.ENDM	GTIM$S

; THE TEST FOR THE EXISTENCE OF THE SYMBOLIC OFFSETS RELATIVE TO THE TIME
; PARAMETERS BUFFER WAS ADDED WITH EDIT 'E05'.
 
;+
;		'GTIM$'
;
; THE GTIM$ MACRO GENERATES A DPB FOR THE "GET TIME PARAMETERS" DIRECTIVE.
;
; MACRO CALL:	GTIM$	BUFADR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE  "GET TIME PARAMETERS"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	BUFADR=ADDRESS OF EIGHT WORD BUFFER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	G.TIBA-(LENGTH 2 BYTES) BUFFER ADDRESS.
;
; THE FOLLOWING OFFSETS ARE ASSIGNED RELATIVE TO THE START OF
; THE TIME PARAMETERS BUFFER:
;
;	G.TIYR-(2) YEAR,
;	G.TIMO-(2) MONTH,
;	G.TIDA-(2) DAY,
;	G.TIHR-(2) HOUR,
;	G.TIMI-(2) MINUTE,
;	G.TISC-(2) SECOND,
;	G.TICT-(2) CLOCK TICK,
;	G.TICP-(2) CLOCK TICKS PER SECOND.
;
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	GTIM$	BUFA
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	59.,2
	.WORD	BUFA
	.ENDC
	.NLIST
	OFF$
	OFF$	G.TIBA,2
$$$OST=0
	.IRP	X,<<G.TIYR,2>,<G.TIMO,2>,<G.TIDA,2>,<G.TIHR,2>>
	OFF$	X
	.ENDM
	.IRP	X,<<G.TIMI,2>,<G.TISC,2>,<G.TICT,2>,<G.TICP,2>>
	OFF$	X
	.ENDM
	.LIST
	.ENDM	GTIM$
;+
;		'GTSK$C'
;
; THE GTSK$C MACRO GENERATES A DPB FOR THE "GET TASK PARAMETERS" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	GTSK$C	BUFADR,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "GET TASK PARAMETERS"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE GTSK$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE GTSK$ MACRO.
;
;-

	.MACRO	GTSK$C	BUFA,CS,ERR
	.MCALL	GTSK$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFT
	GTSK$	BUFA
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	GTSK$C

; THE "GTSK$S" MACRO WAS ALTERED TO GENERATE SYMBOLIC OFFSETS
; WITH EDIT 'E03'.

;+
;		'GTSK$S'
;
; THE GTSK$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "GET TASK PARAMETERS" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	GTSK$S	BUFADR,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "GET TASK PARAMETERS" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE GTSK$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
; THIS MACRO ALSO GENERATES SYMBOLIC OFFSETS RELATIVE TO THE
; TASK PARAMETERS BUFFER AS DESCRIBED IN THE GTSK$ MACRO.
;
;-
	.MACRO	GTSK$S	BUFA,ERR
	.MCALL	MOV$,DIR$,OFF$
	MOV$	BUFA
	MOV	(PC)+,-(SP)
	.BYTE	63.,2
	DIR$	,ERR
	.NLIST
$$$OST=0
	.IRP	X,<<G.TSTN,4>,<G.TSPN,4>,<G.TSRN,4>,<G.TSPR,2>,<G.TSPC,1>>
	OFF$	X
	.ENDM
	.IRP	X,<<G.TSGC,1>,<G.TSNL,2>,<G.TSMT,2>,<G.TSFW,2>,<G.TSVA,2>>
	OFF$	X
	.ENDM
	OFF$	G.TSVL,2
	OFF$	G.TSTS,2
	.LIST
	.ENDM	GTSK$S

; THE 'GTSK$' MACRO WAS ALTERED TO REFLECT THE CHANGE OF THE
; BUFFER SIZE TO 16 WORDS.  THE MACRO DESCRIPTION WAS CHANGED,
; AND SYMBOLIC OFFSETS WERE ADDED WITH EDIT 'E02'.

; THE TEST FOR THE EXISTENCE OF THE SYMBOLIC OFFSETS RELATIVE TO THE TASK
; PARAMETERS BUFFER WAS ADDED WITH EDIT 'E05'.
 
;+
;		'GTSK$'
;
; THE GTSK$ MACRO GENERATES A DPB FOR THE "GET TASK PARAMETERS" DIRECTIVE.
;
; MACRO CALL	GTSK$	BUFADR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "GET TASK PARAMETERS"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	BUFADR=ADDRESS OF A 16 WORD BUFFER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	G.TSBA-(LENGTH 2 BYTES) BUFFER ADDRESS.
;
; THE FOLLOWING OFFSETS ARE ASSIGNED RELATIVE TO THE START OF
; THE TASK PARAMETERS BUFFER:
;
;	G.TSTN-(4) TASK NAME,
;	G.TSPN-(4) PARTITION NAME,
;	G.TSRN-(4) NAME OF TASK'S REQUESTER,
;	G.TSPR-(2) PRIORITY,
;	G.TSGC-(1) UIC GROUP CODE,
;	G.TSPC-(1) UIC PROGRAMMER CODE,
;	G.TSNL-(2) NUMBER OF LOGICAL UNITS,
;	G.TSMT-(2) MACHINE TYPE,
;	G.TSFW-(2) STD FLAGS WORD,
;	G.TSVA-(2) ADDRESS OF TASK SST VECTOR TABLE,
;	G.TSVL-(2) LENGTH (NUMBER OF WORDS) OF TASK SST VECTOR TABLE,
;	G.TSTS-(2) TASK SIZE (IN BYTES).
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-

	.MACRO	GTSK$	BUFA
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	63.,2
	.WORD	BUFA
	.ENDC
	.NLIST
	OFF$
	OFF$	G.TSBA,2
$$$OST=0
	.IRP	X,<<G.TSTN,4>,<G.TSPN,4>,<G.TSRN,4>,<G.TSPR,2>,<G.TSPC,1>>
	OFF$	X
	.ENDM
	.IRP	X,<<G.TSGC,1>,<G.TSNL,2>,<G.TSMT,2>,<G.TSFW,2>,<G.TSVA,2>>
	OFF$	X
	.ENDM
	OFF$	G.TSVL,2
	OFF$	G.TSTS,2
	.LIST
	.ENDM	GTSK$

;+
;		'MRKT$C'
;
; THE MRKT$C MACRO GENERATES A DPB FOR THE "MARK TIME" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	MRKT$C	EFN,TIMMAG,TIMUNIT,AST,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "MARK TIME"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE MRKT$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE MRKT$ MACRO.
;
;-
	.MACRO	MRKT$C	EF,TM,TU,AST,CS,ERR
	.MCALL	MRKT$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	MRKT$	EF,TM,TU,AST
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	MRKT$C
;+
;		'MRKT$S'
;
; THE MRKT$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "MARK TIME" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	MRKT$S	EFN,TIMMAG,TIMUNIT,AST,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "MARK TIME" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE MRKT$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	MRKT$S	EF,TM,TU,AST,ERR
	.MCALL	RVP$,DIR$
	RVP$	EF,TM,TU,AST
	MOV	(PC)+,-(SP)
	.BYTE	23.,5
	DIR$	,ERR
	.ENDM	MRKT$S
;+
;		'MRKT$'
;
; THE MRKT$ MACRO GENERATES A DPB FOR THE "MARK TIME" DIRECTIVE.
;
; MACRO CALL:	MRKT$	EFN,TIMMAG,TIMUNIT,AST
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "MARK TIME"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	EFN=EVENT FLAG NUMBER,
;	TIMMAG=TIME INTERVAL MAGNITUDE,
;	TIMUNIT=TIME INTERVAL UNIT,

;	AST=AST ENTRY ADDRESS.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	M.KTEF-(LENGTH 2 BYTES) EVENT FLAG,
;	M.KTMG-(2) TIME MAGNITUDE,
;	M.KTUN-(2) TIME UNIT,
;	M.KTAE-(2) AST ENTRY ADDRESS.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	MRKT$	EFN,TM,TU,AST
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	23.,5
	.WORD	EFN
	.WORD	TM
	.WORD	TU
	.WORD	AST
	.ENDC
	.NLIST
	.IRP	X,<,<M.KTEF,2>,<M.KTMG,2>,<M.KTUN,2>,<M.KTAE,2>>
	OFF$	X
	.ENDM
	.LIST
	.ENDM	MRKT$

; THE "QIO$?" MACROS WERE ALTERED AND THE TWO MACROS "QDPB$" AND "QDPB$S"
; WERE CREATED TO ACCOMODATE THE NEW "QIOW$?" MACROS WITH EDIT 'E10'.
 
;+
;		'QIO$C'
;
; THE QIO$C MACRO GENERATES A "QUEUE I/O" DPB IN
; A SPECIAL, SEPARATE PSECT AND A MONITOR TRAP
; IN THE ORIGINAL PROGRAM PSECT.
;
; MACRO CALL:	QIO$C	FNC,LUN,EFN,PRI,IOST,AST,PRMLST,PSECT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE PROPER
; "QUEUE I/O" DPB IN THE CONTROL SECTION NAMED
; '$DPB$$'.  ALL OF THE ARGUMENTS THROUGH 'PRMLST' ARE
; AS DESCRIBED FOR THE MACRO 'QIO$'.  THE ARGUMENT
; 'PSECT' SHOULD BE THE NAME OF THE ORIGINAL PROGRAM
; CONTROL SECTION, INTO WHICH THE STANDARD MONITOR
; TRAP CODE WILL BE GENERATED.  THE OPTIONAL ARGUMENT
; 'ERR' IS THE ERROR ROUTINE ADDRESS.  THIS MACRO
; INVOKES QIO$ AND, THEREFORE, FOLLOWS THE SAME EXPANSION
; GUIDELINES.
;
;-
	.MACRO	QIO$C	FNC,LUN,EFN,PRI,IOST,AST,PRMLST,PSCT,ERR
	.MCALL	QDPB$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	QDPB$	1,FNC,LUN,EFN,PRI,IOST,AST,<PRMLST>
	.IFT
	.PSECT	PSCT
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	QIO$C
;+
;		'QIO$S'
;
; THE QIO$S MACRO GENERATES THE CODE TO PUSH A
; "QUEUE I/O" DPB ON THE STACK AND GENERATE
; A MONITOR TRAP.
;
; MACRO CALL:	QIO$S	FNC,LUN,EFN,PRI,IOST,AST,PRMLST,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO
; PUSH THE PROPER "QUEUE I/O" DPB ON THE STACK.
; THE ARGUMENTS THROUGH 'PRMLST' REPRESENT THE
; INFORMATION AS DESCRIBED IN THE MACRO QIO$.
; HOWEVER, THE ARGUMENTS MUST ALL BE VALID
; ASSEMBLER SOURCE OPERANDS. 
;
;-
	.MACRO	QIO$S	FNC,LUN,EFN,PRI,IOST,AST,PRMLST,ERR
	.MCALL	QDPB$S
	QDPB$S	1,FNC,LUN,EFN,PRI,IOST,AST,<PRMLST>,ERR
	.ENDM	QIO$S
;+
;		'QIO$'
;
; THE QIO$ MACRO GENERATES THE "QUEUE I/O" DPB.
;
; MACRO CALL: 	QIO$	FNC,LUN,EFN,PRI,IOST,AST,PRMLST
;
; DESCRIPTION: THIS MACRO GENERATES THE PROPER
; DPB SPECIFIED FOR THE "QUEUE I/O" DIRECTIVE.
; THE ARGUMENTS ARE TREATED AS FOLLOWS:
;
;	FNC-I/O FUNCTION CODE,
;	LUN-LOGICAL UNIT NUMBER,
;	EFN-EVENT FLAG NUMBER,
;	PRI-PRIORITY,
;	IOST-ADDRESS OF I/O STATUS BLOCK,
;	AST-ADDRESS OF I/O DONE AST ENTRY POINT
;	PRMLST-PARAMETER LIST OF THE FORM
;		<P1,...,P6> .
;
; ALL OF THE ARGUMENTS MUST BE VALID EXPRESSIONS
; TO BE USED IN ASSEMBLER DATA STORAGE DIRECTIVES.
; THE FIRST CALL OF THIS MACRO WILL DEFINE THE FOLLOWING
; SYMBOLS AND ASSIGN, AS VALUES, THEIR BYTE OFFSET FROM THE
; BEGINNING OF THE DPB:
;
;	Q.IOFN-(LENGTH 2 BYTES) I/O FUNCTION,
;	Q.IOLU-(2) LOGICAL UNIT NUMBER,
;	Q.IOEF-(1) EVENT FLAG NUMBER,
;	Q.IOPR-(1) PRIORITY,
;	Q.IOSB-(2) ADDRESS OF I/O STATUS BLOCK,
;	Q.IOAE-(2) ADDRESS OF I/O DONE AST ENTRY POINT,
;	Q.IOPL-(0) PARAMETER LIST (UP TO 6 WORDS).
;
; IF THE SYMBOL '$$$GLB' IS DEFINED THE DPB WILL NOT
; BE GENERATED, AND THE SYMBOLIC OFFSETS WILL BE DEFINED
; AS GLOBALS.
;
;-
	.MACRO	QIO$	FNC,LUN,EFN,PRI,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	1,FNC,LUN,EFN,PRI,IOST,AST,<PRMLST>
	.ENDM	QIO$
 
; THE FOLLOWING THREE MACROS FOR THE "QUEUE I/O AND WAIT"
; DIRECTIVE WERE ADDED WITH EDIT 'E10'.
 
;+
;		'QIOW$C'
;
; THE QIOW$C MACRO GENERATES A DPB FOR THE "QUEUE I/O AND WAIT"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER
; SPECIFIED PSECT.
;
; MACRO CALL:	QIOW$C	FNC,LUN,EFN,PRI,IOST,AST,PRMLST,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "QUEUE I/O AND
; WAIT" DIRECTIVE IN THE PROGRAM SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE QIO$ MACRO.  THIS MACRO 
; GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM SECTION
; NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR', IS DESCRIBED
; IN THE 'DIR$' MACRO.  THE GENERATION OF SYMBOLIC OFFSETS IS
; CONTROLLED BY THE QIO$ MACRO.
;
;-
	.MACRO	QIOW$C	FNC,LUN,EFN,PRI,IOST,AST,PRMLST,CS,ERR
	.MCALL	QDPB$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	QDPB$	3,FNC,LUN,EFN,PRI,IOST,AST,<PRMLST>
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	QIOW$C
;+
;		'QIOW$S'
;
; THE QIOW$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "QUEUE I/O AND WAIT" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	QIOW$S	FNC,LUN,EFN,PRI,IOST,AST,PRMLST,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "QUEUE I/O AND WAIT" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE QIO$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS, 'ERR',
; AS DESCRIBED IN THE DIR$S MACRO.
;
;-
	.MACRO	QIOW$S	FNC,LUN,EFN,PRI,IOST,AST,PRMLST,ERR
	.MCALL	QDPB$S
	QDPB$S	3,FNC,LUN,EFN,PRI,IOST,AST,<PRMLST>,ERR
	.ENDM	QIOW$S
;+
;		'QIOW$'
;
; THE QIOW$ MACRO GENERATES A DPB FOR THE "QUEUE I/O AND WAIT" DIRECTIVE.
;
; MACRO CALL:	QIOW$	FNC,LUN,EFN,PRI,IOST,AST,PRMLST
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "QUEUE I/O AND WAIT"
; DIRECTIVE.  THE MACRO ARGUMENTS ARE AS DESCRIBED IN THE QIO$ MACRO.
; THE SYMBOLIC OFFSETS GENERATED ARE AS DESCRIBED FOR THE QIO$ MACRO
; ALSO.
;
;-
	.MACRO	QIOW$	FNC,LUN,EFN,PRI,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	3,FNC,LUN,EFN,PRI,IOST,AST,<PRMLST>
	.ENDM	QIOW$
;+
;		'QDPB$'
;
; THE QDPB$ MACRO WAS CREATED TO ACCOMODATE THE GENERATION OF DPB'S
; FOR THE 'QIO$', 'QIO$C', 'QIOW$', AND 'QIOW$C' MACROS WITHOUT WRITING
; REPETITIVE MACRO DEFINITIONS.
;
;-
	.MACRO	QDPB$	DIC,FNC,LUN,EFN,PRI,IOST,AST,PRMLST
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.NLIST
$$$ARG=6
	.IRP	X,<PRMLST>
$$$ARG=$$$ARG+1
	.ENDM
	.LIST
	.BYTE	DIC,$$$ARG
	.WORD	FNC
	.WORD	LUN
	.BYTE	EFN,PRI
	.WORD	IOST
	.WORD	AST
	.IRP	XTMP,<PRMLST>
	.WORD	XTMP
	.ENDM
	.ENDC
	.NLIST
	.IRP	XTMP,<,<Q.IOFN,2>,<Q.IOLU,2>,<Q.IOEF,1>,<Q.IOPR,1>>
	OFF$	XTMP
	.ENDM
	.IRP	XTMP,<<Q.IOSB,2>,<Q.IOAE,2>,<Q.IOPL>>
	OFF$	XTMP
	.ENDM
	.LIST
	.ENDM	QDPB$
;+
;		'QDPB$S'
;
; THE QDPB$S MACRO WAS CREATED TO ACCOMODATE THE GENERATION OF DPB'S
; FOR BOTH THE 'QIO$S' AND 'QIOW$S' MACROS WITHOUT WRITING
; REPETITIVE MACRO DEFINITIONS.
;
;-
	.MACRO	QDPB$S	DIC,FNC,LUN,EFN,PRI,IOST,AST,PRMLST,ERR
	.MCALL	RVP$,MVB$,DIR$,MOV$
	RVP$	PRMLST
	.NLIST
$$$T1=$$$ARG+6
	.LIST
	MOV$	AST
	MOV$	IOST
	MVB$	EFN,PRI
	MOV$	LUN
	MOV$	FNC
	MOV	(PC)+,-(SP)
	.BYTE	DIC,$$$T1
	DIR$	,ERR
	.ENDM	QDPB$S
;+
;		'RDAF$C'
;
; THE RDAF$C MACRO GENERATES A DPB FOR THE "READ ALL FLAGS" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	RDAF$C	BUFADR,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "READ ALL FLAGS"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE RDAF$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE RDAF$ MACRO.
;
;-
	.MACRO	RDAF$C	BA,CS,ERR
	.MCALL	RDAF$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	RDAF$	BA
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	RDAF$C
;+
;		'RDAF$S'
;
; THE RDAF$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "READ ALL FLAGS" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	RDAF$S	BUFADR,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "READ ALL FLAGS" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE RDAF$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	RDAF$S	BA,ERR
	.MCALL	MOV$,DIR$
	MOV$	BA
	MOV	(PC)+,-(SP)
	.BYTE	39.,2
	DIR$	,ERR
	.ENDM	RDAF$S
;+
;		'RDAF$'
;
; THE RDAF$ MACRO GENERATES A DPB FOR THE "READ ALL FLAGS" DIRECTIVE.
;
; MACRO CALL:	RDAF$	BUFADR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "READ ALL FLAGS"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	BUFADR=ADDRESS OF FOUR WORD BUFFER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	R.DABA-(LENGTH 2 BYTES) BUFFER ADDRESS.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	RDAF$	BA
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	39.,2
	.WORD	BA
	.ENDC
	.NLIST
	OFF$
	OFF$	R.DABA,2.
	.LIST
	.ENDM	RDAF$
;+
;		'RDEF$C'
;
; THE RDEF$C MACRO GENERATES A DPB FOR THE "READ EVENT FLAG" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	RDEF$C	EFN,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "READ EVENT FLAG"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE RDEF$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE RDEF$ MACRO.
;
;-
	.MACRO	RDEF$C	EF,CS,ERR
	.MCALL	RDEF$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	RDEF$	EF
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	RDEF$C

;+
;		'RDEF$S'
;
; THE RDEF$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "READ EVENT FLAG" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	RDEF$S	EFN,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "READ EVENT FLAG" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE RDEF$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	RDEF$S	EF,ERR
	.MCALL	MOV$,DIR$
	MOV$	EF
	MOV	(PC)+,-(SP)
	.BYTE	37.,2
	DIR$	,ERR
	.ENDM	RDEF$S
;+
;		'RDEF$'
;
; THE RDEF$ MACRO GENERATES A DPB FOR THE "READ EVENT FLAG" DIRECTIVE.
;
; MACRO CALL:	RDEF$	EFN
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "READ EVENT FLAG"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	EFN=EVENT FLAG NUMBER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	R.DEEF-(LENGTH 2 BYTES) EVENT FLAG NUMBER.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	RDEF$	EFN
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	37.,2
	.WORD	EFN
	.ENDC
	.NLIST
	OFF$
	OFF$	R.DEEF,2
	.LIST
	.ENDM	RDEF$

;+
;		'RCVD$C'
;
; THE RCVD$C MACRO GENERATES A DPB FOR THE "RECEIVE DATA" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	RCVD$C	TASK,BUFADR,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "RECEIVE DATA"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE RCVD$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE RCVD$ MACRO.
;
;-
	.MACRO	RCVD$C	TN,BA,CS,ERR
	.MCALL	RCVD$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	RCVD$	TN,BA
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	RCVD$C
;+
;		'RCVD$S'
;
; THE RCVD$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "RECEIVE DATA" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	RCVD$S	TSKNAMADR,BUFADR,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "RECEIVE DATA" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE RCVD$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	RCVD$S	TN,BA,ERR
	.MCALL	VDPB$
	VDPB$	17.,TN,BA,,ERR
	.ENDM	RCVD$S

;+
;		'RCVD$'
;
; THE RCVD$ MACRO GENERATES A DPB FOR THE "RECEIVE DATA" DIRECTIVE.
;
; MACRO CALL:	RCVD$	TASK,BUFADR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "RECEIVE DATA"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	TASK=SENDER TASK NAME,
;	BUFADR=ADDRESS OF FIFTEEN WORD BUFFER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	R.VDTN-(LENGTH 4 BYTES) TASK NAME,
;	R.VDBA-(2) BUFFER ADDRESS.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	RCVD$	TN,BA
	.MCALL	VDPB$
	VDPB$	17.,TN,BA,,R.VS
	.ENDM	RCVD$

; THE MACROS FOR THE "RECEIVE DATA OR SUSPEND" DIRECTIVE WERE ADDED
; WITH EDIT 'E03'.

;+
;		'RCVS$C'
;
; THE RCVS$C MACRO GENERATES A DPB FOR THE "RECEIVE DATA OR SUSPEND"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER
; SPECIFIED PSECT.
;
; MACRO CALL:	RCVS$C	TASK,BUFADR,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "RECEIVE DATA OR
; SUSPEND" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE RCVS$ MACRO.  THIS MACRO THEN
; GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL SECTION
; NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR', IS DESCRIBED
; IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC OFFSETS IS
; CONTROLLED BY THE RCVS$ MACRO.
;
;-
	.MACRO	RCVS$C	TN,BA,CS,ERR
	.MCALL	RCVS$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	RCVS$	TN,BA
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	RCVS$C
;+
;		'RCVS$S'
;
; THE RCVS$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "RECEIVE
; DATA OR SUSPEND" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	RCVS$S	TSKNAMADR,BUFADR,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "RECEIVE DATA OR SUSPEND" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY THE
; INFORMATION DESCRIBED IN THE RCVS$ MACRO.  THIS MACRO ALSO GENERATES
; A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS, 'ERR', AS DEFINED
; IN THE DIR$ MACRO.
;
;-
	.MACRO	RCVS$S	TN,BA,ERR
	.MCALL	VDPB$S
	VDPB$S	21.,TN,BA,,ERR
	.ENDM	RCVS$S
;+
;		'RCVS$'
;
; THE RCVS$ MACRO GENERATES A DPB FOR THE "RECEIVE DATA OR SUSPEND"
; DIRECTIVE.
;
; MACRO CALL:	RCVS$	TASK,BUFADR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "RECEIVE DATA OR
; SUSPEND" DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	TASK=SENDER TASK NAME,
;	BUFADR=ADDRESS OF FIFTEEN WORD BUFFER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO THE
; RESPECTIVE DPB ELEMENTS:
;
;	R.VSTN-(LENGTH 4 BYTES) TASK NAME,
;	R.VSBA-(2) BUFFER ADDRESS.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	RCVS$	TN,BA
	.MCALL	VDPB$
	VDPB$	21.,TN,BA,,R.VS
	.ENDM	RCVS$
;+
;		'RCVX$C'
;
; THE RCVX$C MACRO GENERATES A DPB FOR THE "RECEIVE DATA OR EXIT" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	RCVX$C	TASK,BUFADR,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "RECEIVE DATA OR
; EXIT" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE RCVX$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE RCVX$ MACRO.
;
;-
	.MACRO	RCVX$C	TN,BA,CS,ERR
	.MCALL	RCVX$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	RCVX$	TN,BA
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	RCVX$C
;+
;		'RCVX$S'
;
; THE RCVX$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "RECEIVE DATA OR EXIT" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	RCVX$S	TSKNAMADR,BUFADR,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "RECEIVE DATA OR EXIT" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE RCVX$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DEFINED IN THE DIR$ MACRO.
;
;-
	.MACRO	RCVX$S	TN,BA,ERR
	.MCALL	VDPB$S
	VDPB$S	19.,TN,BA,,ERR
	.ENDM	RCVX$S
;+
;		'RCVX$'
;
; THE RCVX$ MACRO GENERATES A DPB FOR THE "RECEIVE DATA OR EXIT" DIRECTIVE.
;
; MACRO CALL: 	RCVX$	TASK,BUFADR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "RECEIVE DATA OR EXIT"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	TASK=SENDER TASK NAME,
;	BUFADR=ADDRESS OF FIFTEEN WORD BUFFER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	R.VXTN-(LENGTH 4 BYTES) TASK NAME,
;	R.VXBA-(2) BUFFER ADDRESS.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-

	.MACRO	RCVX$	TN,BA
	.MCALL	VDPB$
	VDPB$	19.,TN,BA,,R.VX
	.ENDM	RCVX$
;+
;		'RQST$C'
;
; THE RQST$C MACRO GENERATES A DPB FOR THE "REQUEST" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	RQST$C	TASK,PART,PRI,UICGC,UICPC,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "REQUEST"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE RQST$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE RQST$ MACRO.
;
;-
	.MACRO	RQST$C	TN,PN,PR,GC,P,CS,ERR
	.MCALL	RQST$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	RQST$	TN,PN,PR,GC,P
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM
;+
;		'RQST$S'
;
; THE RQST$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "REQUEST" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	RQST$S	TSKNAMADR,PRTNAMADR,PRI,UICGC,UICPC,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "REQUEST" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE RQST$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	RQST$S	TN,PN,PR,GC,P,ERR
	.MCALL	MVB$,MOV$,RFA$,DIR$
	MVB$	P,GC
	MOV$	PR
	RFA$	PN
	RFA$	TN
	MOV	(PC)+,-(SP)
	.BYTE	11.,7
	DIR$	,ERR
	.ENDM	RQST$S
;+
;		'RQST$'
;
; THE RQST$ MACRO GENERATES A DPB FOR THE "REQUEST" DIRECTIVE.
;
; MACRO CALL:	RQST$	TASK,PART,PRI,UIGC,UICPC
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "REQUEST"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	TASK=TASK NAME,
;	PART=PARTITION NAME,
;	PRI=PRIORITY,
;	UICGC=UIC GROUP CODE,
;	UICPC=UIC PROGRAMMER CODE.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	R.QSTN-(LENGTH 4 BYTES) TASK NAME,
;	R.QSPN-(4) PARTITION NAME,
;	R.QSPR-(2) PRIORITY,
;	R.QSGC-(1) UIC GROUP,
;	R.QSPC-(1) UIC PROGRAMMER.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	RQST$	TN,PN,PR,GC,P
	.MCALL	R50$,OFF$
	.IF NDF	$$$GLB
	.BYTE	11.,7
	R50$	TN
	R50$	PN
	.WORD	PR
	.BYTE	P,GC
	.ENDC
	.NLIST
	.IRP	X,<,<R.QSTN,4>,<R.QSPN,4>,<R.QSPR,2>,<R.QSPC,1>,<R.QSGC,1>>
	OFF$	X
	.ENDM
	.LIST
	.ENDM	RQST$

;+
;		'RSUM$C'
;
; THE RSUM$C MACRO GENERATES A DPB FOR THE "RESUME" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	RSUM$C	TASK,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "RESUME"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE RSUM$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE RSUM$ MACRO.
;
;-
	.MACRO	RSUM$C	TN,CS,ERR
	.MCALL	RSUM$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	RSUM$	TN
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	RSUM$C
;+
;		'RSUM$S'
;
; THE RSUM$S GENERATES THE CODE TO PUSH A DPB FOR THE
; "RESUME" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	RSUM$S	TSKNAMADR,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "RESUME" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE RSUM$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	RSUM$S	TN,ERR
	.MCALL	RFA$,DIR$
	RFA$	TN
	MOV	(PC)+,-(SP)
	.BYTE	47.,3
	DIR$	,ERR
	.ENDM	RSUM$S

;+
;		'RSUM$'
;
; THE RSUM$ MACRO GENERATES A DPB FOR THE "RESUME" DIRECTIVE.
;
; MACRO CALL:	RSUM$	TASK
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "RESUME"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	TASK=TASK NAME.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	R.SUTN-(LENGTH 4 BYTES) TASK NAME.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSER ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	RSUM$	TN
	.MCALL	R50$,OFF$
	.IF NDF	$$$GLB
	.BYTE	47.,3
	R50$	TN
	.ENDC
	.NLIST
	OFF$
	OFF$	R.SUTN,4
	.LIST
	.ENDM	RSUM$
;+
;+
;		'SDAT$C'
;
; THE SDAT$C MACRO GENERATES A DPB FOR THE "SEND DATA" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	SDAT$C	TASK,BUFADR,EFN,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "SEND DATA"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE VSDA$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE VSDA$ MACRO.
;
;-
	.MACRO	SDAT$C	TN,BA,EFN,CS,ERR
	.MCALL	VSDA$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	VSDA$	TN,BA,,EFN
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	SDAT$C
;+
;		'SDAT$S'
;
; THE SDAT$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "SEND DATA" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	SDAT$S	TSKNAMADR,BUFADR,EFN,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "SEND DATA" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE SDAT$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP.  USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	SDAT$S	TN,BA,EFN,ERR
	.MCALL	VSDA$S
	VSDA$S	TN,BA,,EFN,,ERR
	.ENDM	SDAT$S

;+
;		'SDAT$'
;
; THE SDAT$ MACRO GENERATES A DPB FOR THE "SEND DATA" DIRECTIVE.
;
; MACRO CALL:	SDAT$	TASK,BUFADR,EFN
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "SEND DATA"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	TASK=RECEIVER TASK NAME,
;	BUFADR=ADDRESS OF THIRTEEN WORD DATA BUFFER,
;	EFN=EVENT FLAG NUMBER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	S.DATN-(LENGTH 4 BYTES) TASK NAME,
;	S.DABA-(2) BUFFER ADDRESS,
;	S.DAEF-(2) EVENT FLAG NUMBER.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	SDAT$	TN,BA,EFN
	.MCALL	VSDA$
	VSDA$	TN,BA,,EFN
	.ENDM	SDAT$

; THE NAME OF THE DIRECTIVE WAS CHANGED TO "SEND DATA AND REQUEST OR
; RESUME RECEIVER".  THE FOLLOWING THREE MACROS WERE ALTERED TO
; REFLECT THAT CHANGE WITH EDIT 'E03'.

;+
;		'SDRQ$C'
;
; THE SDRQ$C MACRO GENERATES A DPB FOR THE "SEND DATA AND REQUEST OR RESUME
; RECEIVER" DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER
; SPECIFIED PSECT.
;
; MACRO CALL:	SDRQ$C	TASK,PART,PRI,UGC,UPC,BUFADR,EFN,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "SEND DATA AND REQUEST
; OR RESUME RECEIVER" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.
; THE DPB PARAMETERS ARE DESCRIBED IN THE SDRQ$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE VSDR$ MACRO.
;
;-
	.MACRO	SDRQ$C	TN,PN,PR,UG,UP,BA,EFN,CS,ERR
	.MCALL	VSDR$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	VSDR$	TN,PN,PR,UG,UP,BA,,EFN
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	SDRQ$C
;+
;		'SDRQ$S'
;
; THE SDRQ$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "SEND DATA
; AND REQUEST OR RESUME RECEIVER" DIRECTIVE ON THE STACK AND A
; MONITOR TRAP.
;
; MACRO CALL:	SDRQ$S	TSKNAMADR,PRTNAMADR,PRI,UGC,UPC,BUFADR,EFN,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "SEND
; DATA AND REQUEST OR RESUME RECEIVER" DIRECTIVE ON THE STACK.  THE DPB
; ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE SDRQ$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP.  USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	SDRQ$S	TN,PN,PR,UG,UP,BA,EFN,ERR
	.MCALL	VSDR$S
	VSDR$S	TN,PN,PR,UG,UP,BA,,EFN,,ERR
	.ENDM	SDRQ$S
;+
;		'SDRQ$'
;
; THE SDRQ$ MACRO GENERATES A DPB FOR THE "SEND DATA AND REQUEST OR RESUME
; RECEIVER" DIRECTIVE.
;
; MACRO CALL:	SDRQ$	TASK,PART,PRI,UGC,UPC,BUFADR,EFN
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "SEND DATA AND REQUEST
; OR RESUME RECEIVER" DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE
; FOLLOWING MEANINGS:
;
;	TASK=RECEIVER TASK NAME,
;	PART=PARTITION,
;	PRI=PRIORITY,
;	UGC=UIC GROUP CODE,
;	UPC=UIC PROGRAMMER CODE,
;	BUFADR=ADDRESS OF THIRTEEN WORD DATA BUFFER,
;	EFN=EVENT FLAG NUMBER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	S.DRTN-(LENGTH 4 BYTES) TASK NAME,
;	S.DRPN-(4) PARTITION NAME,
;	S.DRPR-(2) PRIORITY,
;	S.DRGC-(1) UIC GROUP,
;	S.DRPC-(1) UIC PROGRAMMER,
;	S.DRBA-(2) BUFFER ADDRESS,
;	S.DREF-(2) EVENT FLAG.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	SDRQ$	TN,PN,PR,UG,UP,BA,EFN
	.MCALL	VSDR$
	VSDR$	TN,PN,PR,UG,UP,BA,,EFN
	.ENDM	SDRQ$
;+
;		'SETF$C'
;
; THE SETF$C MACRO GENERATES A DPB FOR THE "SET EVENT FLAG" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	SETF$C	EFN,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "SET EVENT FLAG"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE SETF$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE SETF$ MACRO.
;
;-
	.MACRO	SETF$C	EFN,CS,ERR
	.MCALL	SETF$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	SETF$	EFN
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	SETF$C

;+
;		'SETF$S'
;
; THE SETF$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "SET EVENT FLAG" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	SETF$S	EFN,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "SET EVENT FLAG" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE SETF$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	SETF$S	EFN,ERR
	.MCALL	MOV$,DIR$
	MOV$	EFN
	MOV	(PC)+,-(SP)
	.BYTE	33.,2
	DIR$	,ERR
	.ENDM	SETF$S
;+
;		'SETF$'
;
; THE SETF$ MACRO GENERATES A DPB FOR THE "SET EVENT FLAG" DIRECTIVE.
;
; MACRO CALL:	SETF$	EFN
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "SET EVENT FLAG"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	EFN=EVENT FLAG NUMBER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	S.ETEF-(LENGTH 2 BYTES) EVENT FLAG.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	SETF$	EFN
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	33.,2
	.WORD	EFN
	.ENDC
	.NLIST
	OFF$
	OFF$	S.ETEF,2
	.LIST
	.ENDM	SETF$

;+
;		'SPND$C'
;
; THE SPND$C MACRO GENERATES A DPB FOR THE "SUSPEND" DIRECTIVE IN A
; SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	SPND$C	PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A ONE-WORD DPB FOR THE "SUSPEND"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  AS WITH THE SPND$
; MACRO, NO DPB PARAMETERS ARE REQUIRED, AND NO OFFSETS ARE GENERATED.
; THE MACRO THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM
; CONTROL SECTION AS NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	SPND$C	CS,ERR
	.MCALL	SPND$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	SPND$
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	SPND$C
;+
;		'SPND$S'
;
; THE SPND$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "SUSPEND"
; DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	SPND$S	ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A ONE-WORD DPB FOR
; THE "SUSPEND" DIRECTIVE ON THE STACK.  THEN IT GENERATES A MONITOR TRAP
; USING THE ERROR SERVICE ADDRESS AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	SPND$S	ERR
	.MCALL	DIR$
	MOV	(PC)+,-(SP)
	.BYTE	45.,1
	DIR$	,ERR
	.ENDM	SPND$S

;+
;		'SPND$'
;
; THE SPND$ MACRO GENERATES A DPB FOR THE "SUSPEND" DIRECTIVE.
;
; MACRO CALL:	SPND$
;
; DESCRIPTION: THIS MACRO GENERATES A ONE-WORD DPB FOR THE "SUSPEND"
; DIRECTIVE.  THE MACRO REQUIRES NO ARGUMENTS AND CREATES NO SYMBOLIC
; OFFSETS.  IF THE SYMBOL '$$$GLB' IS DEFINED, THIS MACRO DOES NOTHING.
;
;-
	.MACRO	SPND$
	.IF NDF	$$$GLB
	.BYTE	45.,1
	.ENDC
	.ENDM	SPND$
;+
;		'SPRA$C'
;
; THE SPAR$C MACRO GENERATES A DPB FOR THE "SPECIFY POWER RECOVERY AST"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED
; PSECT.
;
; MACRO CALL:	SPRA$C	AST,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "SPECIFY POWER RECOVERY
; AST" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE SPRA$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE SPRA$ MACRO.
;
;-
	.MACRO	SPRA$C	AST,CS,ERR
	.MCALL	SPRA$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	SPRA$	AST
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	SPRA$C
;+
;		'SPRA$S'
;
; THE SPRA$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "SPECIFY
; POWER RECOVERY AST" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	SPRA$S	AST,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "SPECIFY POWER RECOVERY AST" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE SPRA$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	SPRA$S	AST,ERR
	.MCALL	MOV$,DIR$
	MOV$	AST
	MOV	(PC)+,-(SP)
	.BYTE	109.,2
	DIR$	,ERR
	.ENDM	SPRA$S

;+
;		'SPRA$'
;
; THE SPRA$ MACRO GENERATES A DPB FOR THE "SPECIFY POWER RECOVERY AST"
; DIRECTIVE.
;
; MACRO CALL:	SPRA$	AST
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "SPECIFY POWER RECOVERY
; AST" DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	AST=AST SERVICE ENTRY ADDRESS.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	S.PRAE-(LENGTH 2 BYTES) AST ENTRY ADDRESS.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	SPRA$	AST
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	109.,2
	.WORD	AST
	.ENDC
	.NLIST
	OFF$
	OFF$	S.PRAE,2
	.LIST
	.ENDM	SPRA$
 
; THE FOLLOWING THREE MACROS FOR THE "SPECIFY RECEIVE DATA AST" DIRECTIVE
; WERE ADDED WITH EDIT 'E10'.
 
;+
;		'SRDA$C'
;
; THE SRDA$C MACRO GENERATES A DPB FOR THE "SPECIFY RECEIVE DATA AST"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED
; PSECT.
;
; MACRO CALL:	SRDA$C	AST,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "SPECIFY RECEIVE DATA
; AST" DIRECTIVE IN THE PROGRAM SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE SRDA$ MACRO.  THIS MACRO THEN
; GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM SECTION
; NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR', IS
; DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE SRDA$ MACRO.
;
;-
	.MACRO	SRDA$C	AST,CS,ERR
	.MCALL	SRDA$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	SRDA$	AST
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	SRDA$C
;+
;		'SRDA$S'
;
; THE SRDA$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "SPECIFY
; RECEIVE DATA AST" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	SRDA$S	AST,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "SPECIFY RECEIVE DATA AST" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY THE
; INFORMATION DESCRIBED IN THE SRDA$ MACRO.  THIS MACRO ALSO GENERATES
; A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS, 'ERR', AS
; DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	SRDA$S	AST,ERR
	.MCALL	MOV$,DIR$
	MOV$	AST
	MOV	(PC)+,-(SP)
	.BYTE	107.,2
	DIR$	,ERR
	.ENDM	SRDA$S
;+
;		'SRDA$'
;
; THE SRDA$ MACRO GENERATES A DPB FOR THE "SPECIFY RECEIVE DATA AST"
; DIRECTIVE.
;
; MACRO CALL:	SRDA$	AST
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "SPECIFY RECEIVE DATA AST"
; DIRECTIVE.  THE ARGUMENT IS ASSUMED TO HAVE THE FOLLOWING MEANING:
;
;	AST=AST SERVICE ENTRY ADDRESS.
;
; THE FOLLOWING SYMBOL IS LOCALLY DEFINED WITH ITS ASSIGNED VALUE
; EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO THE DPB
; ELEMENT:
;
;	S.RDAE-(LENGTH 2 BYTES) AST ENTRY ADDRESS.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE DPB IS
; NOT GENERATED, AND THE SYMBOLIC OFFSET IS DEFINED GLOBALLY.
;
;-
	.MACRO	SRDA$	AST
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	107.,2
	.WORD	AST
	.ENDC
	.NLIST
	OFF$
	OFF$	S.RDAE,2
	.LIST
	.ENDM	SRDA$
;+
;		'SVDB$C'
;
; THE SVDB$C MACRO GENERATES A DPB FOR THE "SPECIFY SST VECTOR TABLE FOR
; DEBUGGING AID" DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE
; USER SPECIFIED PSECT.
;
; MACRO CALL:	SVDB$C	ADR,LEN,PSCT,ERR
;
; DESCRIPTION:  THIS MACRO GENERATES A DPB FOR THE "SPECIFY SST VECTOR
; TABLE FOR DEBUGGING AID" DIRECTIVE IN THE CONTROL SECTION '$DPB$$.
; THE DPB PARAMETERS ARE DESCRIBED IN THE SVDB$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE SVDB$ MACRO.
;
;-
	.MACRO	SVDB$C	AD,LN,CS,ERR
	.MCALL	SVDB$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	SVDB$	AD,LN
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	SVDB$C
;+
;		'SVDB$S'
;
; THE SVDB$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "SPECIFY SST VECTOR TABLE FOR DEBUGGING AID" DIRECTIVE ON
; THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	SVDB$S	ADR,LEN,ERR
;
; DESCRIPTION:  THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "SPECIFY SST VECTOR TABLE FOR DEBUGGING AID" DIRECTIVE ON THE STACK.
; THE DPB ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND
; THEY MUST SPECIFY THE INFORMATION DESCRIBED IN THE SVDB$ MACRO.
; THIS MACRO ALSO GENERATES A MONITOR TRAP, USING THE ERROR SERVICE
; ADDRESS, 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	SVDB$S	AD,LN,ERR
	.MCALL	MOV$,DIR$
	MOV$	LN
	MOV$	AD
	MOV	(PC)+,-(SP)
	.BYTE	57.,3
	DIR$	,ERR
	.ENDM	SVDB$S
;+
;		'SVDB$'
;
; THE SVDB$ MACRO GENERATES A DPB FOR THE "SPECIFY SST VECTOR TABLE FOR
; DEBUGGING AID" DIRECTIVE.
;
; MACRO CALL:	SVDB$	ADR,LEN
;
; DESCRIPTION:  THIS MACRO GENERATES A DPB FOR THE "SPECIFY SST
; VECTOR TABLE FOR DEBUGGING AID" DIRECTIVE.  THE ARGUMENTS ARE
; ASSUMED TO HAVE THE FOLLOWING MEANINGS:
;
;	ADR=ADDRESS OF SST VECTOR TABLE,
;	LEN=LENGTH OF (NUMBER OF ENTRIES IN) TABLE.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	S.VDTA-(LENGTH 2 BYTES) TABLE ADDRESS,
;	S.VDTL-(2) TABLE LENGTH.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	SVDB$	A,L
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	57.,3
	.WORD	A
	.WORD	L
	.ENDC
	.NLIST
	.IRP	X,<,<S.VDTA,2>,<S.VDTL,2>>
	OFF$	X
	.ENDM
	.LIST
	.ENDM	SVDB$

;+
;		'SVTK$C'
;
; THE SVTK$C MACRO GENERATES A DPB FOR THE "SPECIFY SST VECTOR TABLE FOR
; TASK" DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED
; PSECT.
;
; MACRO CALL:	SVTK$C	ADR,LEN,PSCT,ERR
;
; DESCRIPTION:  THIS MACRO GENERATES A DPB FOR THE "SPECIFY SST VECTOR TABLE
; FOR TASK" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE SVTK$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE SVTK$ MACRO.
;
;-
	.MACRO	SVTK$C	ADR,LEN,CS,ERR
	.MCALL	SVTK$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	SVTK$	ADR,LEN
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	SVTK$C
;+
;		'SVTK$S'
;
; THE SVTK$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "SPECIFY SST
; VECTOR TABLE FOR TASK" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	SVTK$S	ADR,LEN,ERR
;
; DESCRIPTION:  THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "SPECIFY SST VECTOR TABLE FOR TASK" DIRECTIVE ON THE STACK.
; THE DPB ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS,
; AND THEY MUST SPECIFY THE INFORMATION DESCRIBED IN THE SVTK$ MACRO.
; THIS MACRO ALSO GENERATES A MONITOR TRAP, USING THE ERROR SERVICE
; ADDRESS, 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	SVTK$S	ADR,LEN,ERR
	.MCALL	MOV$,DIR$
	MOV$	LEN
	MOV$	ADR
	MOV	(PC)+,-(SP)
	.BYTE	57.,3
	DIR$	,ERR
	.ENDM	SVTK$S

;+
;		'SVTK$'
;
; THE SVTK$ MACRO GENERATES A DPB FOR THE "SPECIFY SST VECTOR TABLE
; FOR TASK" DIRECTIVE.
;
; MACRO CALL:	SVTK$	ADR,LEN
;
; DESCRIPTION:  THIS MACRO GENERATES A DPB FOR THE "SPECIFY SST
; VECTOR TABLE FOR TASK" DIRECTIVE. THE ARGUMENTS ARE ASSUMED TO
; HAVE THE FOLLOWING MEANINGS:
;
;	ADR=ADDRESS OF SST VECTOR TABLE,
;	LEN=LENGTH OF (NUMBER OF ENTRIES IN) TABLE.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	S.VTTA-(LENGTH 2 BYTES) TABLE ADDRESS,
;	S.VTTL-(2) TABLE LENGTH.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	SVTK$	TA,TL
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	57.,3
	.WORD	TA
	.WORD	TL
	.ENDC
	.NLIST
	.IRP	X,<,<S.VTTA,2>,<S.VTTL,2>>
	OFF$	X
	.ENDM
	.LIST
	.ENDM	SVTK$
;+
;		'VSDA$C'
;
; THE VSDA$C MACRO GENERATES A DPB FOR THE "(VARIED) SEND DATA" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	VSDA$C	TASK,BUFADR,BUFLEN,EFN,SNDPRI,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "(VARIED) SEND DATA"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'. THE DPB
; PARAMETERS ARE DESCRIBED IN THE VSDA$ MACRO. THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'. THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO. THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE VSDA$ MACRO.
;
;-

 
	.MACRO	VSDA$C	TSK,BUF,SIZ,EFN,PRI,CS,ERR
	.MCALL	VSDA$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	VSDA$	TSK,BUF,SIZ,EFN,PRI
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	VSDA$C

;+
;		'VSDA$S'
;
; THE VSDA$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "(VARIED) SEND DATA" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	VSDA$S	TSKNAMADR,BUFADR,BUFLEN,EFN,SNDPRI,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR
; THE "(VARIED) SEND DATA" DIRECTIVE ON THE STACK. THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE VSDA$ MACRO. THIS MACRO ALSO
; GENERATES A MONITOR TRAP. USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-

	.MACRO	VSDA$S	TSK,BUF,SIZ,EFN,PRI,ERR
	.MCALL	MOV$,RFA$,DIR$
$$$T1=5
	.IF NB	<PRI>
$$$T1=7
	MOV	PRI,-(SP)
	MOV$	SIZ
	.IFF
	.IF NB	<SIZ>
$$$T1=6
	MOV	SIZ,-(SP)
	.ENDC
	.ENDC
	MOV$	EFN
	MOV$	BUF
	RFA$	TSK
	MOV	(PC)+,-(SP)
	.BYTE	13.,$$$T1
	DIR$	,ERR
	.ENDM	VSDA$S

;+
;		'VSDA$'
;
; THE VSDA$ MACRO GENERATES A DPB FOR THE "(VARIED) SEND DATA" DIRECTIVE.
;
; MACRO CALL:	VSDA$	TASK,BUFADR,BUFLEN,EFN,SNDPRI
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "(VARIED) SEND DATA"
; DIRECTIVE. THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	TASK=RECEIVER TASK NAME,
;	BUFADR=ADDRESS OF DATA BUFFER,
;	BUFLEN=DATA BUFFER LENGTH (IN WORDS),
;	EFN=EVENT FLAG NUMBER,
;	SNDPRI=PRIORITY OF SEND.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	S.DATN-(LENGTH 4 BYTES) TASK NAME,
;	S.DABA-(2) BUFFER ADDRESS,
;	S.DAEF-(2) EVENT FLAG NUMBER,
;	S.DABL-(2) BUFFER LENGTH,
;	S.DASP-(2) SEND PRIORITY.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	VSDA$	TSK,BUF,SIZ,EFN,PRI
	.MCALL	R50$,OFF$
	.IF NDF	$$$GLB
$$$T1=5
	.IIF NB	<SIZ>,$$$T1=6
	.IIF NB	<PRI>,$$$T1=7
	.BYTE	13.,$$$T1
	R50$	TSK
	.WORD	BA
	.WORD	EFN
	.IIF GE	$$$T1-6,	.WORD SIZ
	.IIF EQ	$$$T1-7,	.WORD PRI
	.ENDC
	.NLIST
	.IRP	X,<,<S.DATN,4>,<S.DABA,2>,<S.DAEF,2>,<S.DABL,2>>
	OFF$ X
	.ENDM
	OFF$	S.DASP,2
	.LIST
	.ENDM	VSDA$

;+
;		'VSDR$C'
;
; THE VSDR$C MACRO GENERATES A DPB FOR THE "(VARIED) SEND DATA AND REQUEST OR
; RESUME RECEIVER" DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE
; USER SPECIFIED PSECT.
;
; MACRO CALL:	VSDR$C	TSK,PRT,RPRI,UGC,UPC,BUFADR,BUFLEN,EFN,SPRI,PSCT,ERR
;
; DESCRIPTION:	THIS MACRO GENERATES A DPB FOR THE "(VARIED) SEND DATA AND
; REQUEST OR RESUME RECEIVER" DIRECTIVE IN THE CONTROL SECTION NAMED
; '$DPB$$. THE DPB PARAMETERS ARE DESCRIBED IN THE VSDR$ MACRO. THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'. THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO. THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE VSDR$ MACRO.
;
;-

	.MACRO	VSDR$C	TSK,PRT,RQPR,UG,UP,BA,BL,EFN,SNDPR,CS,ERR
	.MCALL	VSDR$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	VSDR$	TSK,PRT,RQPR,UG,UP,BA,BL,EFN,SNDPR
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	VSDR$C

;+
;		'VSDR$S'
;
; THE VSDR$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "(VARIED) SEND 
; DATA AND REQUEST OR RESUME RECEIVER" DIRECTIVE ON THE STACK AND A
; MONITOR TRAP.
;
; MACRO CALL:	VSDR$S	TSKADR,PRTADR,RPRI,UGC,UPC,BUFADR,BUFLEN,EFN,SPRI,ERR
;
; DESCRIPTION:	THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "(VARIED) SEND
; DATA AND REQUEST OR RESUME RECEIVER" DIRECTIVE ON THE STACK. THE DPB
; ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE VSDR$ MACRO. THIS MACRO ALSO
; GENERATES A MONITOR TRAP. USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	VSDR$S	TN,PN,RPR,UG,UP,BA,BL,EFN,SNDPR,ERR
	.MCALL	MOV$,MVB$,MOV$,RFA$,DIR$
$$$T1=9.
	.IF NB	<SNDPR>
$$$T1=11.
	MOV	SNDPR,-(SP)
	MOV$	BL
	.IFF
	.IF NB	<BL>
$$$T1=10.
	MOV	BL,-(SP)
	.ENDC
	.ENDC
	MOV$	EFN
	MOV$	BA
	MVB$	UP,UG
	MOV$	PR
	RFA$	PN
	RFA$	TN
	MOV	(PC)+,-(SP)
	.BYTE	15.,$$$T1
	DIR$	,ERR
	.ENDM	VSDR$S

;+
;		'VSDR$'
;
; THE VSDR$ MACRO GENERATES A DPB FOR THE "(VARIED) SEND DATA AND REQUEST OR
; RESUME RECEIVER" DIRECTIVE.
;
; MACRO CALL:	VSDR$	TASK,PART,RPRI,UGC,PC,BUFADR,BUFLEN,EFN,SNDPRI
;
; DESCRIPTION:	THIS MACRO GENERATES A DPB FOR THE "(VARIED) SEND DATA AND 
; REQUEST OR RESUME RECEIVER" DIRECTIVE. THE ARGUMENTS ARE ASSUMED TO HAVE 
; THE FOLLOWING MEANINGS:
;
;	TASK=RECEIVER TASK NAME,
;	PART=PARTITION,
;	RPRI=REQUEST PRIORITY,
;	UGC=UIC GROUP CODE,
;	UPC=UIC PROGRAMMER CODE,
;	BUFADR=ADDRESS OF DATA BUFFER,
;	BUFLEN=LENGTH OF DATA BUFFER (IN WORDS),
;	EFN=EVENT FLAG NUMBER,
;	SNDPRI=PRIORITY OF SEND.
;
; THE FOLLOWING SYMBOLS ARE LOCALY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	S.DRTN-(LENGTH 4 BYTES) TASK NAME,
;	S.DRPN-(4) PARTITION NAME,
;	S.DRPR-(2) REQUEST PRIORITY,
;	S.DRGC-(1) UIC GROUP,
;	S.DRPC-(1) UIC PROGRAMMER,
;	S.DRBA-(2) BUFFER ADDRESS,
;	S.DREF-(2) EVENT FLAG,
;	S.DRBL-(2) BUFFER LENGTH,
;	S.DRSP-(2) SEND PRIORITY.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	VSDR$	TN,PN,RPR,UG,UP,BA,BL,EFN,SNDPR
	.MCALL	R50$,OFF$
	.IF NDF	$$$GLB
$$$T1=9.
	.IIF NB	<BL>,$$$T1=10.
	.IIF NB	<SNDPR>,$$$T1=11.
	.BYTE	15.,$$$T1
	R50$	TN
	R50$	PN
	.WORD	RPR
	.BYTE	UP,UG
	.WORD	BA
	.WORD	EFN
	.IIF	GE	$$$T1-10.,.WORD	BL
	.IIF	EQ	$$$T1-11.,.WORD	SNDPR
	.ENDC
	.NLIST
	.IRP	X,<.<S.DRTN,4>,<S.DRPN,4>,<S.DRPR,2>>
	OFF$	X
	.ENDM
	.IRP	X,<<S.DRPC,1>,<S.DRGC,1>,<S.DRBA,2>,<S.DREF,2>>
	OFF$	X
	.ENDM
	OFF$	S.DRBL,2
	OFF$	S.DRSP,2
	.LIST
	.ENDM	VSDR$

;+
;		'VRCD$C'
;
; THE VRCD$C MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE DATA" DIRECTIVE
; IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	VRCD$C	TASK,BUFADR,BUFLEN,PSCT,ERR
;
; DESCRIPTION:	THIS MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE DATA"
; DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE VRCD$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS,  'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE VRCD$ MACRO.
;
;-

	.MACRO	VRCD$C	TN,BA,BL,CS,ERR
	.MCALL	VRCD$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	VRCD$	TN,BA,BL
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	VRCD$C

;+
;		'VRCD$S'
;
; THE VRCD$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "(VARIED)
; RECEIVE DATA" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	VRCD$S	TSKNAMADR,BUFADR,BUFLEN,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "(VARIED) RECEIVE DATA" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE VRCD$ MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	VRCD$S	TN,BA,BL,ERR
	.MCALL	VDPB$
	VDPB$	17.,TN,BA,BL,ERR
	.ENDM	VRCD$S

;+
;		VRCD$
;
; THE VRCD$ MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE DATA" DIRECTIVE.
;
; MACRO CALL:	VRCD$	TASK,BUFADR,BUFLEN
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "RECEIVE DATA"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING
; MEANINGS:
;
;	TASK=SENDER TASK NAME,
;	BUFADR=ADDRESS OF FIFTEEN WORD BUFFER,
;	BUFLEN=BUFFER LENGTH (IN WORDS).
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	R.VDTN-(LENGTH 4 BYTES) TASK NAME,
;	R.VDBA-(2) BUFFER ADDRESS,
;	R.VDBL-(2) BUFFER LENGTH.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	VRCD$	TN,BA,BL
	.MCALL	VDPB$
	VDPB$	17.,TN,BA,BL,R,VD
	.ENDM	VRCD$

;+
;		'VRCS$C'
;
; THE VRCS$C MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE DATA OR
; SUSPEND" DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE
; USER SPECIFIED PSECT.
;
; MACRO CALL:	VRCS$C	TASK,BUFADR,BUFLEN,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE DATA
; OR SUSPEND" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'. THE DPB
; PARAMETERS ARE DESCRIBED IN THE VRCS$ MACRO. THIS MACRO THEN
; GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL SECTION
; NAMED 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR', IS DESCRIBED
; IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC OFFSETS IS
; CONTROLLED BY THE VRCS$ MACRO.
;
;-
	.MACRO	VRCS$C	TN,BA,BL,CS,ERR
	.MCALL	VRCS$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	VRCS$	TN,BA,BL
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	VRCS$C
;+
;		'VRCS$S'
;
; THE VRCS$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "(VARIED)
; RECEIVE DATA OR SUSPEND" DIRECTIVE ON THE STACK AND A MONITOR
; TRAP.
;
;	MACRO CALL:	VRCS$S	TSKNAMADR,BUFADR,BUFLEN,ERR
;
; DESCRIPTION:  THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "(VARIED)
; RECEIVE DATA OR SUSPEND" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY THE
; INFORMATION DESCRIBED IN THE VRCS$ MACRO.  THIS MACRO ALSO GENERATES
; A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS, 'ERR', AS DEFINED
; IN THE DIR$ MACRO.
;
;-
	.MACRO	VRCS$S	TN,BA,BL,ERR
	.MCALL	VDPB$S
	VDPB$S	21.,TN,BA,BL,ERR
	.ENDM	VRCS$S
;+
;		'VRCS$'
;
; THE VRCS$ MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE DATA OR
; SUSPEND" DIRECTIVE.
;
; MACRO CALL:	VRCS$	TASK,BUFADR,BUFLEN
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE DATA
; OR SUSPEND" DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE
; FOLLOWING MEANINGS:
;
;	TASK=SENDER TASK NAME,
;	BUFADR=ADDRESS OF FIFTEEN WORD BUFFER,
;	BUFLEN=BUFFER LENGTH (IN WORDS).
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO THE
; RESPECTIVE DPB ELEMENTS:
;
;	R.VSTN-(LENGTH 4 BYTES) TASK NAME,
;	R.VSBA-(2) BUFFER ADDRESS,
;	R.VSBL-(2) BUFFER LENGTH.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	VRCS$	TN,BA,BL
	.MCALL	VDPB$
	VDPB$	21.,TN,BA,BL,R.VS
	.ENDM	VRCS$
;+
;		'VRCX$C'
;
; THE VRCX$C MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE DATA OR EXIT"
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED
; PSECT.
; 
; MACRO CALL:	VRCX$C	TASK,BUFADR,BUFLEN,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE
; DATA OR EXIT" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.
; THE DPB PARAMETERS ARE DESCRIBED IN THE VRCX$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE VRCX$ MACRO.
;
;-
	.MACRO	VRCX$C	TN,BA,BL,CS,ERR
	.MCALL	VRCX$,DIR$
	.IF NDF $$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	VRCX$	TN,BA,BL
	,IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	VRCX$C
;+
;		'VRCX$S'
;
; THE VRCX$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "(VARIED)
; RECEIVE DATA OR EXIT" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	VRCX$S	TSKNAMADR,BUFADR,BUFLEN,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE
; "(VARIED) RECEIVE DATA OR EXIT" DIRECTIVE ON THE STACK.  THE DPB
; ARGUMENTS MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST
; SPECIFY THE INFORMATION DESCRIBED IN THE VRCX$ MACRO.   THIS MACRO
; ALSO GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DEFINED IN THE DIR$ MACRO.
;
;-
	.MACRO	VRCX$S	TN,BA,BL,ERR
	.MCALL	VDPB$S
	VDPB$S	19.,TN,BA,BL,ERR
	.ENDM	VRCX$S
;+
;		'VRCX$'
;
; THE VRCX$ MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE DATA
; OR EXIT" DIRECTIVE.
;
; MACRO CALL:	VRCX$	TASK,BUFADR,BUFLEN
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "(VARIED) RECEIVE
; DATA OR EXIT" DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE
; FOLLOWING MEANINGS:
;
;	TASK=SENDER TASK NAME,
;	BUFADR=ADDRESS OF FIFTEEN WORD BUFFER,
;	BUFLEN=LENGTH OF BUFFER (IN WORDS).
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	R.VXTN-(LENGTH 4 BYTES) TASK NAME,
;	R.VXBA-(2) BUFFER ADDRESS,
;	R.VXBL-(2) BUFFER LENGTH.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	VRCX$	TN,BA,BL
	.MCALL	VDPB$
	VDPB$	19.,TN,BA,BL,R,VX
	.ENDM	VRCX$

;+
;		'VDPB$'
;
; THE VDPB$ MACRO IS INTERNALLY CALLED BY THE FOLLOWING MACROS
; TO GENERATE DPB'S AND SYMBOLIC OFFSETS:
;	RCVD$,RCVS$,RCVX$
;	VRCD$,VRCS$,VRCX$
;
;-

	.MACRO	VDPB$	DIC,TSK,BUFA,BUFL,TYP
	.MCALL	R50$,OFF$
$$$T1=4
	.IIF NB	<BUFL>,$$$T1=5
	.BYTE	DIC,$$$T1
	R50$	TSK
	.WORD	BUFA
	.IIF EQ	$$$T1-5,.WORD	BUFL
	.ENDC
	.IF NDF	TYP'TN
	.NLIST
	OFF$
	OFF$	TYP'TN,4
	OFF$	TYP'BA,2
	OFF$	TYP'BL,2
	.LIST
	.ENDC
	.ENDM	VDPB$
;+
;		'VDPB$S'
;
; THE VDPB$S MACRO IS INTERNALLY CALLED BY THE FOLLOWING MACROS
; TO GENERATE THE CODE TO PUSH DPB'S ON THE STACK AND EFFECT
; AN RSX-11D MONITOR TRAP:
;	RCVD$S,RCVS$S,RCVX$S
;	VRCD$S,VRCS$S,VRCX$S
;
;-


	.MACRO	VDPB$S	DIC,TSK,BUFA,BUFL,ERR
	.MCALL	MOV$,RFA$,DIR$
$$$T1=4
	.IF NB	<BUFL>
$$$T1=5
	MOV	BUFL,-(SP)
	.ENDC
	MOV$	BUFA
	RFA$	TSK
	MOV	(PC)+,-(SP)
	.BYTE	DIC,$$$T1
	DIR$	,ERR
	.ENDM	VDPB$S

; THE FOLLOWING THREE MACROS FOR THE "WAIT FOR SIGNIFICANT EVENT" DIRECTIVE
; WERE ADDED WITH EDIT 'E07'.

; THE FOLLOWING THREE MACROS WERE RENAMED WITH EDIT 'E09'.  THIS WAS
; NECESSARY TO REMOVE A CONFLICT WITH THE "WAIT$" MACRO USED IN THE
; THE FILE CONTROL SERVICES.
 
;+
;
;	'WSIG$C'
;
; THE WSIG$C MACRO GENERATES A DPB FOR THE "WAIT FOR SIGNIFICANT EVENT" 
; DIRECTIVE IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	WSIG$C	PSCT,ERR
;
; DESCRIPTION:	THIS MACRO GENERATES A ONE-WORD DPB FOR THE "WAIT FOR
; SIGNIFICANT EVENT" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  AS
; WITH THE WSIG$ MACRO, NO DPB PARAMETERS ARE REQUIRED, AND NO OFFSETS ARE
; GENERATED.  THE MACRO THEN GENERATES A MONITOR TRAP IN THE ORIGINAL
; PROGRAM CONTROL SECTION AS NAMED IN 'PSCT'.  THE ERROR SERVICE
; ADDRESS, 'ERR', IS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	WSIG$C	CS,ERR
	.MCALL	WSIG$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	WSIG$
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	WSIG$C
;+
;
;	'WSIG$S'
;
; THE WSIG$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "WAIT FOR 
; SIGNIFICANT EVENT" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	WSIG$S	ERR
;
; DESCRIPTION:	THIS MACRO GENERATES THE CODE TO PUSH A ONE-WORD DPB
; FOR THE "WAIT FOR SIGNIFICANT EVENT" DIRECTIVE ON THE STACK.  THEN IT 
; GENERATES A MONITOR TRAP USING THE ERROR SERVICE ADDRESS AS DESCRIBED IN
; THE DIR$ MACRO.
;
;-
	.MACRO	WSIG$S	ERR
	.MCALL	DIR$
	MOV	(PC)+,-(SP)
	.BYTE	49.,1
	DIR$	,ERR
	.ENDM	WSIG$S
;+
;
;	'WSIG$'
;
; THE WSIG$ MACRO GENERATES A DPB FOR THE "WAIT FOR SIGNIFICANT EVENT"
; DIRECTIVE.
;
; MACRO CALL:	WSIG$
;
; DESCRIPTION:	THIS MACRO GENERATES A ONE-WORD DPB FOR THE "WAIT FOR
; SIGNIFICANT EVENT" DIRECTIVE. THE MACRO REQUIRES NO ARGUMENTS AND CREATES
; NO SYMBOLIC OFFSETS.  IF THE SYMBOL '$$$GLB' IS DEFINED, THIS MACRO
; DOES NOTHING.
;
;-
	.MACRO	WSIG$
	.IF NDF	$$$GLB
	.BYTE	49.,1
	.ENDC
	.ENDM	WSIG$
;+
;		'WTLO$C'
;
; THE WTLO$C MACRO GENERATES A DPB FOR THE "WAIT FOR LOGICAL 'OR' OF EVENT
; FLAGS IN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED PSECT.
;
; MACRO CALL:	WTLO$C	SET,MASK,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "WAIT FOR LOGICAL 'OR' OF
; EVENT FLAGS" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE WTLO$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE WTLO$ MACRO.
;
;-
	.MACRO	WTLO$C	SET,MASK,CS,ERR
	.MCALL	WTLO$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	WTLO$	SET,<MASK>
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	WTLO$C
 
; THE FOLLOWING MACRO WAS REWRITTEN WITH EDIT 'E12' TO MAKE "WTLO$S"
; CONSISTENT WITH ALL OTHER "$S" MACRO FORMS.
 
;+
;		'WTLO$S'
;
; THE WTLO$S MACRO GENERATES  THE CODE TO PUSH A DPB FOR THE "WAIT FOR
; LOGICAL 'OR' OF EVENT FLAGS" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	WTLO$S	SET,MASK,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "WAIT
; FOR LOGICAL 'OR' OF EVENT FLAGS" DIRECTIVE ON THE STACK.  THE ARGUMENTS
; ARE ASSUMED TO HAVE THE FOLLOWING MEANINGS:
;
;	SET=DESIRED SET OF EVENT FLAGS (0-4),
;	MASK=IF SET IS 0,1,2,OR 3, A SINGLE ASSEMBLER SOURCE
;		OPERAND REPRESENTING A MASK WORD,
;	     IF SET IS 4, A LIST OF 4 ASSEMBLER SOURCE OPERANDS
;		OF THE FORM <M1,M2,M3,M4>, REPRESENTING FOUR
;		MASK WORDS.
;
; THE MACRO ALSO GENERATES A MONITOR TRAP, USING THE ERROR SERVICE
; ADDRESS, 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	WTLO$S	SET,MSK,ERR
	.MCALL	MOV$,RVP$,DIR$
	.IF EQ	SET-4
	.NLIST
$$$T1=0
	.IRP	X,<MSK>
$$$T1=$$$T1+1
	.ENDM
	.LIST
	.REPT	<4-$$$T1>
	CLR	-(SP)
	.ENDR
	RVP$	MSK
	.IFF
	MOV$	MSK
	.IF NE	SET
	MOV	#SET,-(SP)
	.IFF
	CLR	-(SP)
	.ENDC
	.IFTF
	MOV	(PC)+,-(SP)
	.IFT
	.BYTE	43.,5
	.IFF
	.BYTE	43.,3
	.ENDC
	DIR$	,ERR
	.ENDM	WTLO$S
;+
;		'WTLO$'
;
; THE WTLO$ MACRO GENERATES A DPB FOR THE "WAIT FOR LOGICAL 'OR' OF EVENT
; FLAGS" DIRECTIVE.
;
; MACRO CALL:	WTLO$	SET,MASK
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "WAIT FOR LOGICAL 'OR'
; OF EVENT FLAGS" DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE
; FOLLOWING MEANINGS:
;
;	SET=DESIRED SET OF EVENT FLAGS (0-4),
;	MASK=IF SET IS 0,1,2,OR 3, A SIXTEEN BIT (16 FLAG) MASK WORD,
;            IF SET IS 4, A LIST OF FOUR MASK WORDS (<M1,M2,M3,M4>).
;
; THERE ARE NO SYMBOLIC OFFSETS DEFINED BY THIS MACRO.  IF THE SYMBOL
; '$$$GLB' IS DEFINED AT MACRO INVOCATION, NOTHING IS GENERATED.
;
;-
	.MACRO	WTLO$	SET,MASK
	.IF NDF	$$$GLB
	.IF EQ	SET-4
	.BYTE	43.,5
	.IRP	X,<MASK>
	.WORD	X
	.ENDM
	.IFF
	.BYTE	43.,3
	.WORD	SET
	.WORD	MASK
	.ENDC
	.ENDC
	.ENDM	WTLO$
;+
;		'WTSE$C'
;
; THE WTSE$C MACRO GENERATES A DPB FOR THE "WAIT FOR SINGLE EVENT FLAG"
; DIRECTIVEIN A SEPARATE PSECT AND A MONITOR TRAP IN THE USER SPECIFIED
; PSECT.
;
; MACRO CALL:	WTSE$C	EFN,PSCT,ERR
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "WAIT FOR SINGLE EVENT
; FLAG" DIRECTIVE IN THE CONTROL SECTION NAMED '$DPB$$'.  THE DPB
; PARAMETERS ARE DESCRIBED IN THE WTSE$ MACRO.  THIS MACRO
; THEN GENERATES A MONITOR TRAP IN THE ORIGINAL PROGRAM CONTROL
; SECTION NAMED IN 'PSCT'.  THE ERROR SERVICE ADDRESS, 'ERR',
; IS DESCRIBED IN THE DIR$ MACRO.  THE GENERATION OF SYMBOLIC
; OFFSETS IS CONTROLLED BY THE WTSE$ MACRO.
;
;-
	.MACRO	WTSE$C	EF,CS,ERR
	.MCALL	WTSE$,DIR$
	.IF NDF	$$$GLB
	.PSECT	$DPB$$
$$$=.
	.IFTF
	WTSE$	EF
	.IFT
	.PSECT	CS
	DIR$	#$$$,ERR
	.ENDC
	.ENDM	WTSE$C

;+
;		'WTSE$S'
;
; THE WTSE$S MACRO GENERATES THE CODE TO PUSH A DPB FOR THE 'WAIT FOR
; SINGLE EVENT FLAG" DIRECTIVE ON THE STACK AND A MONITOR TRAP.
;
; MACRO CALL:	WTSE$S	EFN,ERR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH A DPB FOR THE "WAIT
; FOR SINGLE EVENT FLAG" DIRECTIVE ON THE STACK.  THE DPB ARGUMENTS
; MUST BE VALID ASSEMBLER SOURCE OPERANDS, AND THEY MUST SPECIFY
; THE INFORMATION DESCRIBED IN THE WTSE$S MACRO.  THIS MACRO ALSO
; GENERATES A MONITOR TRAP, USING THE ERROR SERVICE ADDRESS,
; 'ERR', AS DESCRIBED IN THE DIR$ MACRO.
;
;-
	.MACRO	WTSE$S	EF,ERR
	.MCALL	MOV$,DIR$
	MOV$	EF
	MOV	(PC)+,-(SP)
	.BYTE	41.,2
	DIR$	,ERR
	.ENDM	WTSE$S
;+
;		'WTSE$'
;
; THE WTSE$ MACRO GENERATES A DPB FOR THE "WAIT FOR SINGLE EVENT FLAG"
; DIRECTIVE.
;
; MACRO CALL:	WTSE$	EFN
;
; DESCRIPTION: THIS MACRO GENERATES A DPB FOR THE "WAIT FOR SINGLE EVENT FLAG"
; DIRECTIVE.  THE ARGUMENTS ARE ASSUMED TO HAVE THE FOLLOWING MEANING:
;
;	EFN=EVENT FLAG NUMBER.
;
; THE FOLLOWING SYMBOLS ARE LOCALLY DEFINED WITH THEIR ASSIGNED
; VALUES EQUAL TO THE BYTE OFFSET FROM THE START OF THE DPB TO
; THE RESPECTIVE DPB ELEMENTS:
;
;	W.TSEF-(LENGTH 2 BYTES) EVENT FLAG NUMBER.
;
; IF THE MACRO IS INVOKED WITH THE SYMBOL '$$$GLB' DEFINED, THE
; DPB IS NOT GENERATED, AND THE SYMBOLIC OFFSETS ARE DEFINED
; GLOBALLY.
;
;-
	.MACRO	WTSE$	EFN
	.MCALL	OFF$
	.IF NDF	$$$GLB
	.BYTE	41.,2
	.WORD	EFN
	.ENDC
	.NLIST
	OFF$
	OFF$	W.TSEF,2
	.LIST
	.ENDM	WTSE$

;+
;		'DIR$'
;
; GENERATES AN RSX-11D MONITOR TRAP WITH A PRE-DEFINED DPB.
;
; MACRO CALL:	DIR$	ADR,ERR
;
; DESCRIPTION: THE ARGUMENT 'ADR' MUST BE A VALID ASSEMBLER
; SOURCE OPERAND USED TO PUSH THE DPB ADDRESS ON THE STACK.
; THE MACRO THEN GENERATES AN 'EMT 375' TO TRAP TO
; THE MONITOR.  THE ARGUMENT 'ERR' IS OPTIONAL.  IF
; DEFINED, IT MUST BE A VALID ASSEMBLER DESTINATION
; OPERAND TO PERMIT A 'JUMP TO SUBROUTINE' TO AN
; ERROR HANDLER IF THE MONITOR CALL FAILS.
;
;-
	.MACRO	DIR$	ADR,ERR
	.MCALL	ERR$
	.IF NB	<ADR>
	MOV	ADR,-(SP)
	.ENDC
	EMT	375
	.IIF NB	<ERR>,	ERR$	ERR
	.ENDM	DIR$
;+
;		'ERR$'
;
; THIS IS AN INTERNAL MACRO USED TO GENERATE A TEST FOR
; DIRECTIVE FAILURE ACCOMPANIED BY A JSR TO AN ERROR HANDLER.
;
; MACRO CALL:	ERR$	ERR
;
; DESCRIPTION: DIRECTIVE FAILURE IS INDICATED BY A SET C-BIT.
; IF THE ARGUMENT 'ERR' IS DEFINED, CODE IS GENERATED TO
; TEST THE C-BIT AND SKIP IF NOT SET.  THAT IS FOLLOWED
; BY A JSR TO AN ERROR HANDLER SPECIFIED BY 'ERR'.
;
;-
	.MACRO	ERR$	ERR
	.MCALL	CALL
	.IF NB	<ERR>
	.NLIST
	.NTYPE	$$$T1,ERR
	.LIST
	.IIF EQ	$$$T1-27,	BCC	.+6
	.IIF EQ	$$$T1-37,	BCC	.+6
	.IF GE	$$$T1-60
	BCC	.+6
	.IFF
	.IF NE	$$$T1-27
	.IIF NE	$$$T1-37,	BCC	.+4
	.ENDC
	.ENDC
	CALL	ERR
	.ENDC
	.ENDM	ERR$
;+
;		'MVB$'
;
; THIS IS AN INTERNAL MACRO USED TO PUSH TWO BYTES ON THE STACK.
;
; MACRO CALL:	MVB$	LOWB,HIGHB
;
; DESCRIPTION: THIS MACRO EXAMINES THE TWO ARGUMENTS, AND, BASED
; ON THAT EXAMINATION, GENERATES THE CODE TO PUSH THE BYTES ON THE
; STACK.
;
;-
	.MACRO	MVB$	LOW,HIGH
	.IF B	<LOW>
	.IF B	<HIGH>
	CLR	-(SP)
	.IFF
	CLRB	-(SP)
	MOVB	HIGH,1(SP)
	.ENDC
	.IFF
	.IF B	<HIGH>
	CLR	-(SP)
	MOVB	LOW,(SP)
	.IFF
	MOVB	LOW,-(SP)
	MOVB	HIGH,1(SP)
	.ENDC
	.ENDC
	.ENDM	MVB$
;+
;		'NBL$'
;
; THIS INTERNAL MACRO RETURNS THE NUMBER OF NON-BLANK ARGUMENTS IN
; AN ARGUMENT LIST.
;
; MACRO CALL:	NBL$	<A1,A2,...,AN>
;
; DESCRIPTION: THIS MACRO RETURNS THE NUMBER OF NON-BLANK (AS DEFINED BY THE
; 'NB' CONDITIONAL) ARGUMENTS IN THE ARGUMENT LISTS IN '$$$ARG'.
;
;-
	.MACRO	NBL$	LIST
	.NLIST
$$$ARG=0
	.IRP	X,<LIST>
	.IIF NB	<X>,$$$ARG=$$$ARG+1
	.ENDM
	.LIST
	.ENDM	NBL$
;+
;		'OFF$'
;
; THIS IS AN INTERNAL MACRO USED TO CALCULATE SYMBOLIC
; OFFSETS.
;
; MACRO CALL:	OFF$	SYMB,LEN
;
; DESCRIPTION: THIS MACRO IS USED TO CREATE TABLES OF
; SYMBOLIC OFFSETS FOR THE ELEMENTS WITHIN DPB'S.
; THE FIRST ARGUMENT, 'SYMB', IS THE NAME OF THE
; SYMBOL.  IF IT IS BLANK THE OFFSET COUNTER IS
; SET TO TWO.  THE SECOND ARGUMENT, 'LEN', IS THE
; LENGTH OF THE SYMBOL IN BYTES.  IT IS ADDED
; TO THE OFFSET COUNTER AFTER THE SYMBOLIC ASSIGN-
; MENT HAS BEEN MADE.  IF THE SYMBOL '$$$GLB' IS
; DEFINED THE SYMBOLIC ASSIGNMENTS WILL BE MADE
; GLOBAL.  OTHERWISE, ALL ASSIGNMENTS ARE LOCAL.
;
;-

	.MACRO	OFF$	SYMB,LEN
	.IF NB	<SYMB>
	.IF NDF	$$$GLB
SYMB=$$$OST
	.IFF
SYMB==$$$OST
	.ENDC
	.IF NB	<LEN>
$$$OST=$$$OST+LEN
	.ENDC
	.IFF
$$$OST=2
	.ENDC
	.ENDM	OFF$
;+
;		'RFA$'
;
; THIS INTERNAL MACRO PUSHES TWO WORDS ON THE STACK IN REVERSE
; ORDER FROM THE SPECIFIED DOUBLE-WORD.
;
; MACRO CALL:	RFA$	ADR
;
; DESCRIPTION: THIS MACRO GENERATES THE CODE TO PUSH TWO WORDS
; ON THE STACK IN REVERSE ORDER FROM THE DOUBLE WORD WITH ITS
; ADDRESS SPECIFIED BY THE SOURCE OPERANDS 'ADR'.
;
;-
	.MACRO	RFA$	ADR
	.IF NB	<ADR>
	.NLIST
	.NTYPE	$$$T2,ADR
	.LIST
	.IF LT	$$$T2-6
	MOV	2(ADR),-(SP)
	MOV	(ADR),-(SP)
	.IFF
	MOV	ADR,-(SP)
	MOV	@(SP),-(SP)
	ADD	#2,2(SP)
	MOV	@2(SP),2(SP)
	.ENDC
	.IFF
	CLR	-(SP)
	CLR	-(SP)
	.ENDC
	.ENDM	RFA$
;+
;		'RVP$'
;
; THIS IS AN INTERNAL MACRO USED TO PLACE THE PARAMETERS
; PASSED AS AN ARGUMENT LIST INTO THE STACK IN REVERSE
; ORDER.
;
; MACRO CALL:	RVP$	A1,A2,...,A10
;
; DESCRIPTION: THE ELEMENTS OF THE ARGUMENT LIST ARE
; PUSHED ON THE STACK IN REVERSE ORDER.  ALL ELEMENTS
; ARE ASSUMED TO BE FULL-WORD.  THE LIST IS LIMITED TO
; A MAXIMUM OF TEN ELEMENTS.
;
;-
	.MACRO	RVP$	P0,P1,P2,P3,P4,P5,P6,P7,P8,P9
	.MCALL	MOV$
	.NLIST
	.NARG	$$$ARG
	.LIST
	.IIF GT	$$$ARG-9.,	MOV$	<P9>
	.IIF GT	$$$ARG-8.,	MOV$	<P8>
	.IIF GT	$$$ARG-7,	MOV$	<P7>
	.IIF GT	$$$ARG-6,	MOV$	<P6>
	.IIF GT	$$$ARG-5,	MOV$	<P5>
	.IIF GT	$$$ARG-4,	MOV$	<P4>
	.IIF GT	$$$ARG-3,	MOV$	<P3>
	.IIF GT	$$$ARG-2,	MOV$	<P2>
	.IIF GT	$$$ARG-1,	MOV$	<P1>
	.IIF GT	$$$ARG,	MOV$	<P0>
	.ENDM	RVP$
 
; THE 'R50$' MACRO WAS MODIFIED WITH EDIT 'E04' TO INSURE THAT
; A MAXIMUM OF TWO WORDS WOULD BE GENERATED BY ANY CALL.
 
;+
;		'R50$'
;
; THIS INTERNAL MACRO GENERATES A TWO-WORD RADIX-50 NAME.
;
; MACRO CALL:	R50$	NAME
;
; DESCRIPTION: THIS MACRO WILL CONVERT THE ARGUMENT 'NAME' INTO
; RADIX-50 USING THE '.RAD50' ASSEMBLER DIRECTIVE.  FURTHERMORE,
; THE MACRO INSURES THAT THE DATA GENERATED IS AT LEAST TWO
; WORDS LONG.
; 
;-
	.MACRO	R50$	NAME
	.NLIST
	.NCHR	$$$T1,NAME
	.LIST
	.IF EQ	$$$T1
	.WORD	0,0
	.IFF
	.IF GT	$$$T1-6
$$$T4=.+4
	.IFTF
	.RAD50	/NAME/
	.IFT
.=$$$T4
	.ENDC
	.IIF LT	$$$T1-4,	.WORD	0
	.ENDC
	.ENDM	R50$
 
; THE MOV$ MACRO WAS ALTERED TO RUN MORE EFFICIENTLY WITH EDIT 'E10'.  IT
; WAS ORIGINALLY CODED TO RUN PROPERLY ON SEVERAL MACRO-11 ASSEMBLERS THAT
; DID NOT HANDLE THE '.MEXIT' DIRECTIVE CORRECTLY WHEN INSIDE THE '.IRP'
; REPEAT CODE.
 
; THE MOV$ MACRO WAS ALSO ALTERED WITH EDIT 'E12' TO PRODUCE MORE
; EFFICIENT CODE (WHEN ARGUMENT PASSED IS #0).
 
;+
;		'MOV$'
;
; THIS IS AN INTERNAL MACRO USED TO PUSH AN ARGUMENT ON THE STACK.
;
; MACRO CALL:	MOV$	<ARG>
;
; DESCRIPTION: THIS MACRO IS USED TO PUSH AN ARGUMENT ON THE STACK.
; THE MACRO EXAMINES THE ARGUMENT FIRST TO DETERMINE WHICH
; CODE WILL BE VALID TO PERFORM THE PUSH.  IF THE ARGUMEMT IS
; NULL OR #0, A 'CLR -(SP)' INSTRUCTION IS USED. OTHERWISE,
; A 'MOV ARG,-(SP)' INSTRUCTION IS USED.
;
;-
	.MACRO	MOV$	ARG
	.IF	NB	<ARG>
	.IF	DIF	<ARG>,<#0>
	MOV	ARG,-(SP)
	.MEXIT
	.ENDC	
	.ENDC
	CLR	-(SP)
	.ENDM	MOV$


;
	.NLIST

.TITLE	MACROS TO GENERATE STATE AND KEYWORD TABLES

; VERSION 0005
;
;
; ANDREW C. GOLDSTEIN  5 MAR 75  20:58

; INITIALIZE TABLE GENERATION - CALL ONCE AT START OF EACH
; FINITE STATE MACHINE DESCRIPTION. USER MUST SUPPLY LABELS
; FOR THE STATE AND KEYWORD TABLES.

.MACRO	ISTAT$	STTBL,KEYTBL

	.MCALL	MTRAN$

	.IF	DF	$RONLY
	.PSECT	$STATE,D,RO
	.IFF
	.PSECT	$STATE,D
	.ENDC
STTBL::

	.IF	DF	$RONLY
	.PSECT	$KTAB,D,RO
	.IFF
	.PSECT	$KTAB,D
	.ENDC
KEYTBL::
	$$$KEY = -1
	$$$FLG = -1

	$EXIT = 0
	$LAMDA = 300
	$NUMBR = 302
	$STRNG = 304
	$BLANK = 306
	$SUBXP = 310
	$EOS   = 312
	$DNUMB = 314
	$RAD50 = 316
	$ANY   = 320

	.PSECT
.ENDM	ISTAT$

; DECLARE A STATE

.MACRO	STATE$	LABEL
	.PSECT	$STATE

	$$$FLG = $$$FLG!200
	MTRAN$

	.IF	NB	LABEL
LABEL:
	.ENDC

	$$$FLG = -1

	.PSECT
.ENDM	STATE$

; SPECIFY A STATE TRANSITION

.MACRO	TRAN$	TYPE,LABEL,ACTION
	.PSECT	$STATE

	MTRAN$

	.IF	NB	ACTION
	$$$FLG = $$$FLG!2
	.MACRO	$$$ACT
	.WORD	ACTION
	.ENDM	$$$ACT
	.ENDC

	.IF	NB	LABEL
	$$$FLG = $$$FLG!4
	$$$STA = LABEL
	.ENDC

	.IRPC	X,<TYPE>
	.IF	IDN	<X>,<">

	.PSECT	$KTAB
	$$$TMP = .
	.ASCII	TYPE
	.IF	GT	.-$$$TMP-7
	.ERROR	"KEYWORD TOO LONG"
	.ENDC

	.REPT	$$$TMP+8.-.
	.BYTE	377
	.ENDR

	.MACRO	$$$TYP
	.BYTE	$$$KEY!200
	.ENDM	$$$TYP

	$$$KEY = $$$KEY+1
	.IF	GT	$$$KEY-63.
	.ERROR	"TOO MANY KEYWORDS"
	.ENDC

	.MEXIT
	.ENDC

	.IF	IDN	<X>,<!>

	$$$FLG = $$$FLG!1
	.MACRO	$$$EXT
	.WORD	0'TYPE
	.ENDM	$$$EXT

	.MACRO	$$$TYP
	.BYTE	$SUBXP
	.ENDM	$$$TYP

	.MEXIT
	.ENDC

	.MACRO	$$$TYP
	.BYTE	TYPE
	.ENDM	$$$TYP

	.MEXIT
	.ENDM

	.PSECT
.ENDM	TRAN$

; OUTPUT LAST TRANSITION ENTRY

.MACRO	MTRAN$

	.PSECT	$STATE

	.IF	EQ	$$$FLG+1
	$$$FLG = 0
	.MEXIT
	.ENDC

	$$$TYP
	.BYTE	$$$FLG

	.IF	NE	$$$FLG&1
	$$$EXT
	.ENDC

	.IF	NE	$$$FLG&2
	$$$ACT
	.ENDC

	.IF	NE	$$$FLG&4
	.WORD	$$$STA
	.IFF
	.IF	EQ	$$$FLG&200
	.ERROR	"BAD DEFAULT TRANSITION"
	.ENDC
	.ENDC

	$$$FLG = 0

.ENDM	MTRAN$

	.LIST