ATCTL.MAC;10/au/-bf=[13,10]ATCTL.MAC;1
-42,44,/;DLE001/
	AT.HDR==10		; ATTRIBUTE IS IN HEADER AREA
	AT.IDN==4		; ATTRIBUTE IS IN IDENT AREA
	AT.MAP==2		; ATTRIBUTE IS IN MAP AREA
	at.sub==1		; Attribute is not a subroutine (if on)
-51,51,/;DLE001/
; This consists of two tables
; The first table....
; THE BYTE CONTAINS THE MAXIMUM NUMBER OF BYTES THAT MAY BE TRANSFERED
-56,61,/;DLE001/
; The 2nd table.....
;	Is an address of a subroutine or...
;
; 	THE 1st BYTE IS THE ATTRIBUTE CONTROL BYTE.
; THE BITS ARE DEFINED ABOVE. Bit 0 must be a 1 or the routine will think it is 
;		a subroutine addres
; 	THE 2nd BYTE IS THE BYTE OFFSET OF THE ATTRIBUTE FROM
; THE BEGINNING OF THE SPECIFIED SECTION OF THE FILE HEADER OR FROM
; THE FCB.  THIS VALUE IS ASSUMED AS A 7 BIT UNSIGNED VALUE
-74,111,/;DLE001/
	.list meb
	.macro	mktabr	count,offset,flags,sub
	$pdata
	.byte	count
	$code1
	.if b sub
	.byte	<flags>!at.sub,offset
	.iff
	.word	sub
	.endc
	$pdata		; come back to here
	.endm	mktabr

	.macro	mktabw	count,offset,flags,sub
	$pdata
	.byte	count
	.if b sub
	.byte	<flags>!at.sub,offset
	.iff
	.word	sub
	.endc
	$pdata		; come back to here
	.endm	mktabw

;	Init the psects and the address of the structures
	$pdata
	.even
.atctc::
	$code1
	.even
.atctf::
	mktabr	6,H.FOWN,AT.HDR!AT.PRO,.atsu1	; 1-Owner's uic (and #2, #3)
	mktabr	4,H.FPRO,AT.HDR!AT.PRO,.atsu2	; 2-File protection code (and #3)

	mktabr	2,H.UCHA,AT.HDR		; 3-User controlled file char

	mktabr	32.,H.UFAT,AT.HDR	; 4-USER'S FILE ATTRIBUTES

	mktabr	10.,I.FNAM,AT.IDN!AT.PRO,.atsu5	; 5-FILE NAME-(& #6, #7)
	mktabr	4,I.FTYP,AT.IDN!AT.PRO,.atsu6	; 6-FILE TYPE-(& #7)

	mktabr	2,I.FVER,AT.IDN!AT.PRO,.atsu7	; 7-FILE VERSION

	mktabr	I.DASZ,I.EXDT,AT.IDN!AT.PRO ; 8-EXPIRATION DATE

	mktabr	S.STBK,F.LBN,AT.RO!AT.FCB ; 9-STATISTICS BLOCK READ ONLY

	mktabr	0,0,AT.RO,.atsua	; 10-COMPLETE FILE HEADER READ ONLY

	mktabr	10.,V.VOWN,AT.RO!AT.VCB!AT.PRO ; 11 - DEC PRIVATE
					; Read volume protection hack

	mktabr	-2,0,0			; 12-VMS tape user labels 

	mktabr	35.,I.RVNO,AT.IDN!AT.PRO,.atsue	;13 COMPLETE DATE INFORMATION
					; CREATION/REVISION/EXPIRATION

	mktabr	-1,0,0			; 14-ALLOCATION CONTROL PROCESSED
					; ONLY BY EXTEND OR CREATE

	mktabr	-2,0,0			; 15-VMS tape "end of label processing"

	mktabr	-2,0,0			; 16-VMS ASCII name, type, version

	mktabr	8.,I.CRDT,AT.IDN!AT.PRO ; 17-64 bit creation date and time

	AT.CRD==<.-.ATCTC>		; Attribute type code for create date

	mktabr	8.,I.RVDT,AT.IDN!AT.PRO ; 18-64 bit revision date and time
	mktabr	8.,I.EXDT,AT.IDN!AT.PRO ; 19-64 bit expiration date

	AT.EXD==<.-.ATCTC>		; Attribute type code for expir date

	mktabr	8.,i.bkdt,at.idn!AT.PRO	; 20-64 bit backup date (NOOP)

	.ATMAX==<.-.ATCTC>
	.ACBMX==6			; Maximum entries in control block

	.EVEN				; We are at psect pdata here

.atctl::	; For the write routine

	mktabw	6,H.FOWN,AT.HDR!AT.PRO	; 1-Owner's uic (and #2, #3)
	mktabw	4,H.FPRO,AT.HDR!AT.PRO	; 2-File protection code (and #3)

	mktabw	2,H.UCHA,AT.HDR		; 3-User controlled file char

	mktabw	32.,H.UFAT,AT.HDR	; 4-USER'S FILE ATTRIBUTES

	mktabw	10.,I.FNAM,AT.IDN!AT.PRO ; 5-FILE NAME-(& #6, #7)
	mktabw	4,I.FTYP,AT.IDN!AT.PRO	; 6-FILE TYPE-(& #7)

	mktabw	2,I.FVER,AT.IDN!AT.PRO	; 7-FILE VERSION

	mktabw	I.DASZ,I.EXDT,AT.IDN!AT.PRO ; 8-EXPIRATION DATE

	mktabw	S.STBK,F.LBN,AT.RO!AT.FCB ; 9-STATISTICS BLOCK READ ONLY

	mktabw	0,0,AT.RO		; 10-COMPLETE FILE HEADER READ ONLY

	mktabw	10.,V.VOWN,AT.RO!AT.VCB!AT.PRO ; 11 - DEC PRIVATE
					; Read volume protection hack

	mktabw	-2,0,0			; 12-VMS tape user labels 

	mktabw	35.,I.RVNO,AT.IDN!AT.PRO ;13 COMPLETE DATE INFORMATION
					; CREATION/REVISION/EXPIRATION

	mktabw	-1,0,0			; 14-ALLOCATION CONTROL PROCESSED
					; ONLY BY EXTEND OR CREATE

	mktabw	-2,0,0			; 15-VMS tape "end of label processing"

	mktabw	-2,0,0			; 16-VMS ASCII name, type, version

	mktabw	8.,I.CRDT,AT.IDN!AT.PRO ; 17-64 bit creation date and time

	mktabw	8.,I.RVDT,AT.IDN!AT.PRO ; 18-64 bit revision date and time
	mktabw	8.,I.EXDT,AT.IDN!AT.PRO ; 19-64 bit expiration date

	mktabw	8.,i.bkdt,at.idn!AT.PRO	; 20-64 bit backup date (NOOP)

	.EVEN				; We are at psect pdata here
-115,115,/;DLE001/
/
