Google
 

Trailing-Edge - PDP-10 Archives - AP-D543V_SB - datdmp.mac
There are 5 other files named datdmp.mac in the archive. Click here to see a list.
SUBTTL DATDMP - DATA BASE DUMPER V425  C. WHITE 15 MAY 73
;COPYRIGHT (C) 1976,1977,1978 BY DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
VDTDMP==425

INTERN	DATDMP,PPNTST,NAMTST,EXTTST

	REPEAT 0,<
;LOADING AND USE OF USER MODE DATDMP:
;
;TO LOAD TYPE:
;	.LOAD %P DATDMP=S+CONFIG+DATDMP+COMMOD
;	.SAVE DSK:DATDMP
;
;THERE WILL BE ABOUT 37 UNDEFINED GLOBALS, IGNORE
; THEM.
;
;TO USE:
;	.R DATDMP
;	*FILE
;THIS WILL DUMP THE CORE BLOCKS FOR FILE ON THE LPT.
;THE DEFAULT FILE IS *.*[*.*].  DATDMP DOES NOT KNOW
;ABOUT ? WILDCARDS.
;
;LOADING AND USE OF EXEC MODE DATDMP:
;
;TO LOAD TYPE:
;	.COMPILE COMMOD=S+CONFIG+DATDMP+COMMOD
;
;LOAD THE MONITOR WITH THIS VERSION OF COMMOD.REL.  WRITE
;DOWN THE VALUE OF DATDMP AND SAVE IT.
;TO LOOK AT A CRASH START AT DATDMP.  [IF YOU HAVE CRASH.XPN
;USE FILEX TO GENERATE CRASH.SAV THEN LOAD THAT WITH BOOTS
;AND START AT DATDMP]
;AC1 SHOULD BE A PUSHDOWN POINTER.  IF YOU ARE USING EDDT
;TYPE: PUSHJ P,DATDMP$X
;YOUR LISTING WILL COME OUT ON THE LINE PRINTER.
;
;
;HOW TO READ THE OUTPUT (EXEC OR USER)
;
;***SEE COMMOD FOR DESCRIPTION OF FIELDS***
;
;
;DATDMP FIRST DUMPS SYSPPB THE EACH PPB AND THE FILES
; IN IT.
;
;ONLY THE SUFIX IS PRINTED.  THUS UNDER A UFB IS A NUMBER
;LABELED TAL.  THIS FIELD IS THEN UFBTAL AND IS DESCRIBED
;IN COMMOD.  COMMOD IS IN ALPHABETIC ORDER BY PREFIX SO
;IT IS EASY TO FIND WHAT YOU WANT.
;
;ALL OUTPUT IS IN OCTAL EXCEPT KNO/YES WHICH ARE RADIX 2
;[ONE BIT FOR EACH STR]
;
;IF A SINGLE BIT IS A 1 IT IS SOMETIMES PRINTED AS A Y
;IF A SINGLE BIT IS A 0 IT IS SOMETIMES PRINTED AS AN N
;
;IF AN UNDEFINED BIT IS A 1 AN ! WILL BE PRINTED
;
;EXAMPLE:
;
;UNDER AT'S IS CNT/STS SO WE LOOK UP ACCCNT
;AN ACCSTS [AN AT IS AN ACC AND AN AKB IF THE
;SUFFIX IS NOT UNDER ACC LOOK UNDER AKB].  ASSUME
;DATDMP TYPED CNT/STS N3 1 N N.  THEN WE KNOW
;	1.  THE FILE IS IN A UFD (ACPNIV=0 BECAUSE AN N WAS PRINTED)
;	2.  THERE ARE 3 USERS OF THIS FILE (ACYUSE=3)
;	3.  THE FILE IS BEING UPDATED (ACSYS=1)
;	4.  THE FILE IS NOT BEING RENAMED (ACPREN=0)
;	5.  THE FILE IS NOT MARKED FOR DELETION (ACPDEL=0)
;
;***WARNING*** IF YOU UNDERSTAND FILFND THIS WILL BE
;CLEAR.  IF YOU ARE DO NOT UNDERSTAND FILFND CHANCES
;ARE YOU WILL NOT UNDERSTAND DATDMP OUTPUT
>

IFNDEF SUBSW,<SUBSW==1>

DATDMP:	MOVEM	17,EXACS+17	;SAVE AC 17 IN CASE WE'RE IN EXEC MODE
	SETZM	MODMON		;ASSUME EXEC MODE OPERATION
	JSP	17,.+1
	TLNE	17,USRMOD	;ASCERTAIN WHICH MODE WE'RE IN
	JRST	USROUT		;USER MODE
	MOVEI	17,EXACS	;SETUP BLT OF ACS
	BLT	17,EXACS+16
	CONO	LPT,LPTCLR	;DO GOOD THINGS FOR LPT
	JRST	EXOUT

USROUT:	MOVE	P,IPDP		;SETUP PUSHDOWN LIST

IFN SUBSW,<
	TTCALL	OUTSTR,[ASCIZ .
*.]
	CALLI	0
	PUSHJ	P,GETNAM
	  JRST	USROUT
	CALLI	0
>

	MOVEI	J,0
	MOVE	S,[XWD SYSLN,CNFTBL]	;GET SIZE OF MONITOR
	CALLI	S,CI.GET
	  JRST	NOSIZE		;CANT GET SIZE OF MONITOR
	SUBI	S,1
	CALLI	S,CI.SPY	;GET MONITOR AS HISEG
	  JRST	OHDEAR		;NO GOOD - COMPLAIN
	INIT	LP,0		;TRY TO INIT O/P DEV.
	  SIXBIT /LPT/
	  XWD	LPTOB,0
	  JRST	NOLPT		;NO O/P DEV. - GO COMPLAIN
	OUTBUF	LP,^D12		;LOTSABUFFS
	MOVE	P1,[SIXBIT /DATDMP/]
	MOVSI	P2,(SIXBIT /TXT/)
	SETZB	P3,P4		;CLEAR DATE & PPN
	ENTER	LP,P1		;IN CASE IT ISN'T A LPT
	  JRST	NOTABL		;IT ISN'T - AND WE HAVE PROBS.
	MOVE	S,XSYSPB	;ARG. FOR GETTAB UUO TO GET SYSPPB WORD
	CALLI	S,CI.GET
	  JRST	NOGTAB		;NO GOOD - COMPLAIN
	MOVEM	S,SYSPPB	;SAVE IT
	MOVEI	J,SIGN		;SET UP MODIFIER FOR HISEG REFERENCES
	MOVEM	J,MODMON	;SAVE IT FOR LATER USE - EXEC/USER MODE TEST
EXOUT:	MOVEI	T4,M1
	PUSHJ	P,MSG		;PRINT OUT HEADER
	HLRZ	P3,SYSPPB	;GET ADR. OF 1ST. PPB IN SYSTEM
	MOVE	T1,P3
	PUSHJ	P,OCT6		;PRINT IT OUT
	HRRZ	T1,SYSPPB	;GET ADR. OF PPB WHERE CORE GRABBER SHOULD START
	PUSHJ	P,OCT6		;PRINT IT

NXTPPB:	MOVEM	P3,CURPPB	;SAVE CURRENT PPB ADR.
	TDO	P3,MODMON	;MODIFY P3 ACCORDING TO MODE

IFN SUBSW,<
	HLRZ	T1,PPNTST	;PROJECT TO TEST
	JUMPE	T1,PPBT1	;JUMP IF ANY PROJECT MATCHES
	HLRZ	T2,PPBNAM(P3)	;GET CURRENT PROJECT
	CAME	T1,T2
	JRST	NOPPBP		;DOESNT MATCH, MOVE TO NEXT PPB
PPBT1:	HRRZ	T1,PPNTST	;PROJECT OK, TEST PROGRAMMER NUMBER
	JUMPE	T1,PPBT2	;OK IF ANY PROG MATCHES
	HRRZ	T2,PPBNAM(P3)	;GET CURRENT PROG
	CAME	T1,T2
	JRST	NOPPBP		;DOESNT MATCH, NEXT PPB
PPBT2:
>

	HLRZ	P4,PPBUFB(P3)	;GET ADR. OF 1ST. UFB OF THIS PPB
	TDO	P4,MODMON
	SETOM	NOACC		;CLEAR SWITCH THAT INHIBITS PRINTING OF ACC'S
	TRNN	P4,377777	;ANY UFB'S?
	SETZM	NOACC		;NO, DISABLE UFB/ACC PRINTING
	SETOM	MT8		;CLEAR FLAG THAT INDICATES .GT. 8 BLKS TO BE O/P
	MOVEI	J,CN0NUM	;CONTROL PRINT OUT TYPE
	MOVSI	P1,MSTRNM	;MAX. -VE # OF STR'S PER USER
	PUSHJ	P,PRDAT		;PRINT OUT PPB AND ALL ITS UFB'S
	HLRZ	P3,PPBNMB(P3)	;GET ADR. OF 1ST. NMB OF THIS PPB
	JUMPE	P3,NONMBS	;NO NMB - DON'T TRY TO PRINT ANYTHING
NXTNMB:	HRLM	P3,CURNMB	;JUST FOR CONVENIENCE OF O/P RTNE.
	TDO	P3,MODMON

IFN SUBSW,<
	SKIPN	NAMTST		;SKIP UNLESS ANY NAME MATCHES
	JRST	NMBT1
	MOVE	T1,NMBNAM(P3)	;CURRENT FILE NAME
	CAME	T1,NAMTST
	JRST	NONMBP		;DOESNT MATCH, MOVE TO NEXT NMB
NMBT1:	SKIPN	EXTTST		;SKIP UNLESS ANY EXT MATCHES
	JRST	NMBT2
	HLLZ	T1,NMBEXT(P3)	;GET CURRENT EXT
	HRLZ	T2,EXTTST	;GET EXT LOOKING FOR

IFN FTSFD,<
	CAME	T2,[SIXBIT .SFD.] ;SKIP IF LOOKING FOR SFD
	JRST	NMBNSF		;NO, USE NORMAL TEST
	MOVE	T1,NMBSFD(P3)	;PICK UP SFD BIT
	TRNN	T1,NMPSFD	;SKIP IF THIS IS AN SFD
	JRST	NONMBP		;NO, SKIP IT
	JRST	NMBT2		;YES, MATCHES
NMBNSF:
>	;END CONDITIONAL ON FTSFD
	CAME	T1,T2
	JRST	NONMBP
NMBT2:
>

	HLRZ	P4,NMBACC(P3)	;GET ADR. OF 1ST. ACC.
	TDO	P4,MODMON
	SETOM	NOACC		;ASSUME NMB HAS AN ACCESS TABLE
	TRNE	P4,LOWBTS	;DOES IT HAVE ONE?
	SETZM	NOACC		;NO - FLAG IT SO ACC WON'T BE O/P
	HLRZ	W,ACCAKB(P4)	;GET ADR. OF 1ST. AKB.
	TDO	W,MODMON
	MOVEM	W,FIRAKB	;SAVE ADR. OF 1ST. AKB
	MOVEI	J,CN1NUM	;CONTROL PRINT OUT TYPE
	MOVSI	P1,-^D512	;MAX. -VE # OF AT'S PER NMB
	PUSHJ	P,PRDAT		;PRINT OUT NMB AND ALL ITS ACCESS TABLES
NONMBP:IFE FTSFD,<
	HLRZ	P3,CORLNK(P3)	;GET NEXT NMB ADR.
	JUMPN	P3,NXTNMB	;IF THERE IS ONE GO ROUND AGAIN
>
IFN FTSFD,<
	MOVE	T1,NMBSFD(P3)	;PICK UP SFD BLAG
	TRNE	T1,NMPSFD	;SKIP IF THIS WAS NOT AN SFD
	HLRZ	P3,NMBEXT(P3)	;IT WAS, EXT POINTS TO NMB RING FOR SFD
	TRNN	T1,NMPSFD	;SKIP IF THIS WAS AN SFD
SFEN:	HLRZ	P3,CORLNK(P3)	;NO, USE NORMAL LINK TO NEXT NMB
	JUMPE	P3,NONMBS	;JUMP IF END OF LIST
	TRZN	P3,NMPUPT	;SKIP IF END OF SFD NMB RING
	JRST	NXTNMB		;NO, DO REGULAR NMB
	TDO	P3,MODMON
	JRST	SFEN		;YES, MOVE UP TO HIGHER LEVEL
>	;END CONDITIONAL FTSFD
NONMBS:	MOVSI	T1,-^D132
	HRRI	T1,"*"		;SHOW THAT ALL NMB'S FOR THIS PPB ARE O/P
	PUSHJ	P,MCHPNT
	MOVEI	T3,14		;FORM FEED
	PUSHJ	P,TYO
	MOVE	P3,CURPPB	;PICK UP CURRENT PPB ADR.
	TDO	P3,MODMON
NOPPBP:	HLRZ	P3,CORLNK(P3)	;GET NEXT PPB ADR.
	JUMPN	P3,NXTPPB	;IF THERE IS ONE GO ROUND AGAIN
	SKIPE	MODMON		;WE'VE FINISHED
	JRST	EXACS		;IN USER MODE
	MOVEI	T3,14		;IN EXEC MODE
	PUSHJ	P,TYO		;BE HELPFUL AND GIVE A FORM FEED
	MOVSI	17,EXACS	;RESTORE ACS
	BLT	17,17
IFN SUBSW,<
	SETZM	PPNTST
	SETZM	NAMTST
	SETZM	EXTTST
>

	POPJ	P,		;RETURN TO DDT

EXACS:	RELEASE	LP,0		;THESE 16 LOCS ARE USED FOR STORING ACS IN EXEC MODE
	CALLI	CI.EXT

NOSIZE:	ADDI	J,400		;ERR 5 - CANT GET SIZE OF MONITOR
OHDEAR:	ADDI	J,400		;ERR 4 - CANT GET MONITOR AS HIGH SEG
NOLPT:	ADDI	J,400		;ERR 3 - CANT OPEN LPT
NOTABL:	ADDI	J,400		;ERR 2 - CANT ENTER FILE ON LPT
NOGTAB:	ADD	J,ERRBAS	;ERR 1 - CANT GET SYSPPB
OPIT:	TTCALL	3,J		;O/P ERROR MSG.
	HALT	USROUT		;START OVER WHEN FAULT REMEDIED

ERRBAS:	ASCIZ	/ERR1/

UTYO:	SOSG	LPTOB+2		;ANY SPACE LEFT?
	OUTPUT	LP,		;NO - O/P THIS BUFFER
	IDPB	T3,LPTOB+1	;PUT CH. IN BUFFER
	POPJ	P,		;RETURN

LPTOB:	BLOCK	3

IPDP:	XWD	-40,DSKDDB	;USE DISK PROTYPE DDB(USER MODE ONLY)

MODMON:	Z			;MODE WE'RE RUNNING IN - 400000 IF USRMOD. 0 IF EXEC
CURPPB:
CURNMB:	Z			;LH=CURRENT NMB ADR. RH=CURRENT PPB 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BJN	M,NXTRWP
	SKIPL	MT8		;ARE THERE MORE THAN 8 UFB'S/ACC'S TO BE O/P?
	JRST	MORBLK		;YES
	POPJ	P,
SPAC20:	MOVSI	T1,-^D20
	HRRI	T1," "
	PJRST	MCHPNT

FINEXT:	SKIPGE	T4,MT8PRC
	HALT	.
	JUMPN	T4,ENDBLK
	MOVEI	T4,[ASCIZ /TOO MANY /]
	PUSHJ	P,MSG
	MOVEI	T4,[ASCIZ /UFB'S/]
	SKIPE	J
	MOVEI	T4,[ASCIZ /AT'S/]
	PUSHJ	P,MSG
	JRST	ENDBLK


MT8:	EXP	-1
MT8PRC:	EXP	-1
FIRBLK:	Z
FSTTIM:	Z
BLKCNT:	Z
BLKADR:	Z
CURTBA:	Z
CURINA:	Z
	PO3==1		;PRINT  3  OCTAL DIGITS
	PO4==2		;  "    4    "     "
	PO6==3		;  "    6    "     "
PO12==4		;  "   12    "     "
	PB7==5		;  "    7 BINARY   "
	PSB==6		;  "   UPTO 6 SIXBIT CHS.
	PPP==7		;  "   A PRJ-PRG # OR INITIAL PAIR
	PNY==10	;  "   N OR Y     DEPENDING ON WHETHER A 1 BIT FLAG IS 0 OR 1
	PCN==11	;  "   SPACE OR !     "     "     "    AN UNUSED FIELD IS 0 OR NON 0

POMSIZ==4
POMPOS==^D17

	NBK==20	;END OF BLOCK
	NL==40	;O/P A CRLF. NO MORE O/P ON THIS LINE
	ONLY==100	;ONLY O/P ON FIRST PASS THRU TABLE
ONLNO==200	;DON'T O/P THE MSG.
ONLMS==400	;ONLY O/P THE MSG
	OSP==1000	;O/P ONE SPACE AFTER EVERYTHING ELSE
	NOSP==2000	;DON'T O/P ANY SPACES
	LESP==4000	;O/P A SPACE BEFORE ANY INFO. OTHER THAN MSG.

	LP==0
LOWBTS==3
LPTDON==100
LPTCLR==2000
USRMOD==10000
SPYSIZ==77777
	SIGN==400000
BITMSK==777000

TTY==LP
OUTSTR==3
LF==12
SYSLN==12
CNFTBL==11

CI.EXT==12
CI.GPP==24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J	P,MCHPNT
TPOPJ:	POP	P,T1
CPOPJ:	POPJ	P,

POCT36:	TRNN	T1,BITMSK
	PJRST	OCT3
	ADDI	F,3
	PJRST	OCT6

;XCT TABLE FOR "JBTPPN"

PICKUP:	HLRZS	T1
	HLLZ	T2,T1
PICKP1:	HRRZ	T1,(P)
	HRLZ	T2,(P)
POUT:	PUSHJ	P,POCT36
	PUSHJ	P,SIXBPS
IFN FTSFD,<
;SUBROUTINE TO CHECK IF NMB IS FOR SFD AND RETURN PROPER FILE EXTENSION
;VALUES T2=FILE EXTENSION OR SFD IF FILE IS AN SFD
GSFEXT:	MOVE	T2,NMBSFD(P3)	;GET SFD BIT
	TRNE	T2,NMPSFD	;SKIP IF THIS IS NOT AN SFD
	SKIPA	T2,[SIXBIT .SFD.] ;IT IS, EXTENSION IS KNOWN TO BE SFD
	HLLZ	T2,NMBEXT(P3)	;NO, PICK UP NORMAL EXTENSION
	POPJ	P,		;RETURN
>	;END CONDITIONAL ON FTSFD
OCT3:	MOVSI	T3,-3
	JRST	OCTPNT

OCT4:	MOVSI	T3,-4
	JRST	OCTPNT

BIN7:	MOVEI	R,2
	MOVSI	T3,-7
	SETOM	T4
	JRST	RADPNT

OCT12:	MOVSI	T3,-^D12
	JUMPGE	T1,OCTPNT
	MOVE	T4,T1
	MOVEI	T2,^D12
OCT12A:	SETZ	T3,
	ROTC	T3,3
	ADDI	T3,60
	PUSHJ	P,TYO
	SOJG	T2,OCT12A
	POPJ	P,

OCT6:	MOVSI	T3,-6
OCTPNT:	MOVEI	R,^D8
	SETZM	T4
RADPNT:	AOBJN	T3,.+1
	IDIVI	T1,(R)
	HRLM	T2,(P)
	SKIPE	T1
	PUSHJ	P,RADPNT
	JUMPGE	T3,RADPN1
	HLL	T1,T3
	HRRI	T1," "
	SKIPGE	T4
	HRRI	T1,"0"
	PUSHJ	P,MCHPNT
RADPN1:	HLRZ	T3,(P)
	ADDI	T3,60

TYO:	SKIPE	MODMON
	JRST	UTYO
ETYO:	L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AIE	T2,"*"
	MOVEM	T2,NAMTST
	HRROS	EXTTST
	SKIPE	PPNFLG
	JRST	NAM0
	CALLI	T1,CI.GPP
	MOVEM	T1,PPNTST
	JRST	NAM0
NAM2:	CAIE	T1,"["
	JRST	NAM3
	PUSHJ	P,NAMCHK
	PUSHJ	P,OCTRD
	CAIN	T1,"*"
	PUSHJ	P,STARCK
	CAIE	T1,","
	JRST	FILERR
	HRLZM	T2,PPNTST
	PUSHJ	P,OCTRD
	CAIN	T1,"*"
	PUSHJ	P,STARCK
	CAIE	T1,"]"
	JRST	FILERR
	HRRM	T2,PPNTST
	SETOM	PPNFLG
	JRST	NAM0
NAM3:	CAIE	T1,"/"
	JRST	NAM4
	PUSHJ	P,TTI
	CAIN	T1,"H"
	JRST	HELPMS
	JRST	FILERR
NAM4:	CAIE	T1,","
	JRST	NAM5
	SKIPE	NAMTST
	JRST	FILERR
	MOVE	T3,T2		;T3=CHARS READ
	MOVE	T4,[POINT 6,T3]
	SETZ	T1,
SIXOC1:	TLNN	T4,770000
	JRST	NAM4A
	ILDB	T2,T4		;T2=NEXT CHAR
	JUMPE	T2,NAM4A	;QUIT IF NO MORE CHARS
	SUBI	T2,20		;CONVERT SIXBIT TO BINARY
	CAILE	T2,7		;SKIP IF OCTAL DIGIT
	JRST	FILERR
	LSH	T1,3
	ADD	T1,T2
	JRST	SIXOC1
NAM4A:	HRLM	T1,(P)		;REMEMBER PROJECT NUMBER
	PUSHJ	P,OCTRD		;READ PROGRAMMER NUMBER
	HLL	T2,(P)		;RESTORE PROJECT
	JRST	NAM0A		;AND PRETEND WE HAVE A FILE NAME
NAM5:	CAIL	T1,40
	JRST	FILERR
	PUSHJ	P,NAMCHK
CPOPJ1:	AOS	(P)
	POPJ	P,

NAMCHK:	JUMPE	T2,CPOPJ
	SKIPN	EXTTST
	JRST	NAMCH1
	CAIN	T2,"*"
	TDZA	T2,T2
	HLROS	T2
	MOVEM	T2,EXTTST
	POPJ	P,
NAMCH1:	CAIE	T2,"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B ACCESS PRIVS.
	HLRZ	T1,UFBPPB(P4)	;NEXT UFB ADR.
	LDB	T1,[POINT PPSHNO,PPBKNO(P3),PPNHNO]	;LEFT MOST 7 PPB KNO BITS
	MOVE	T1,UFBPT1(P4)	;1ST. RETRIEVAL PTR.
	LDB	T1,[POINT UFS1PT,UFB1PT(P4),UFN1PT]	;ONLY RETRIEVAL PTR. BIT
	LDB	T1,[POINT PPSHNO,PPBKNO(P3),PPNKNO]	;RIGHT MOST 7 PPB KNO BITS
	LDB	T1,[POINT PPSZ10,PPBZ10(P3),PPNZ10]	;SHOULD BE 0
	HLRZ	T1,UFBWRT(P4)	;RESERVED FOR FIRST COME FIRST SERVE QUOTA
	HRRZ	T1,UFBWRT(P4)	;# BLOCKS WRITTEN IN UFD(OR MFD) ITSELF
	LDB	T1,[POINT PPSHES,PPBYES(P3),PPNHES]	;LEFT MOST 7 PPB YES BITS
	LDB	T1,[POINT PPSHES,PPBYES(P3),PPNYES]	;RIGHT MOST 7 PPB YES BITS
	LDB	T1,[POINT PPSNLG,PPBNLG(P3),PPNNLG]	;PPN NOT LOGGED IN BIT
	LDB	T1,[POINT PPSZ30,PPBZ30(P3),PPNZ30]	;SHOULD BE 0
	HALT	.
;*** INSTRUCTION TABLE #1 ***

CN1INS:	HLRZ	T1,CURNMB	;NMB ADR.
	ADD	T1,P4		;ACC ADR.
	MOVE	T2,NMBNAM(P3)	;FILE NAME
	LDB	T1,[POINT ACSFSN,ACCFSN(P4),ACNFSN]	;ACC FSN #
	LDB	T1,[POINT AKSUN1,AKBUN1(W),AKNUN1]	;AKB UN1
	IFN	FTSFD,<PUSHJ P,GSFEXT	;FILE EXTENSION.  CHECK FOR SFD>
	IFE	FTSFD,<HLLZ T2,NMBEXT(P3) ;FILE EXTENSION>
	HLRZ	T1,ACCAKB(P4)	;AKB ADR.
	HRRZ	T1,ACCPPB(P4)	;PPB ADR.
	HLRZ	T1,NMBPPB(P3)	;NEXT NMB ADR.
	HLRZ	T1,ACCNMB(P4)	;NEXT ACC ADR.
	HRRZ	T1,NMBCFP(P3)	;COMPRESSED FILE PTR.
	LDB	T1,[POINT ACSNIU,ACCNIU(P4),ACNNIU]	;FILE NOT IN UFD BIT
	LDB	T1,[POINT ACSCNT,ACCCNT(P4),ACNCNT]	;FILE CHANNEL READ COUNT
	LDB	T1,[POINT ACSSTS,ACCSTS(P4),ACNSTS]	;ACCESS TABLE STATUS
	LDB	T1,[POINT ACSREN,ACCREN(P4),ACNREN]	;RENAME UUO IN PROGRESS BIT
	LDB	T1,[POINT ACSDEL,ACCDEL(P4),ACNDEL]	;FILE TO BE DELETED BIT
	LDB	T1,[POINT NMSHNO,NMBKNO(P3),NMNHNO]	;LEFT MOST 7 NMB KNO BITS
	MOVE	T1,ACCWRT(P4)	;HIGHEST REL. BLK. WRITTEN
	LDB	T1,[POINT NMSHNO,NMBKNO(P3),NMNKNO]	;RIGHT MOST 7 NMB KNO BITS
	HLRZ	T1,ACCDOR(P4)	;FORWARDS DORMANT ACCESS BLK. ADR.
	HRRZ	T1,ACCDOR(P4)	;BACKWARDS DORMANT ACCESS BLK. ADR.
	LDB	T1,[POINT NMSHES,NMBYES(P3),NMNHES]	;LEFT MOST 7 NMB BITS
	MOVE	T1,AKBALC(W)	;HIGHEST REL. BLK. ALLOCATED TO FILE
	LDB	T1,[POINT NMSHES,NMBYES(P3),NMNYES]	;RIGHT MOST 7 NMB BITS
	LDB	T1,[POINT AKSZ10,AKBZ10(W),AKNZ10]	;SHOULD BE 0
	LDB	T1,[POINT AKSADT,AKBADT(W),AKNADT]	;ACCESS DATE FOR THIS FILE
	LDB	T1,[POINT AKSABC,AKBABC(W),AKNABC]	;ALWAYS BAD CHECKSUM BIT
	LDB	T1,[POINT AKSLBS,AKBLBS(W),AKNLBS]	;LAST BLOCK IN FILE
	LDB	T1,[POINT AKSDIR,AKBDIR(W),AKNDIR]	;FILE IS A DIRECTORY BIT
	LDB	T1,[POINT AKSZ12,AKBZ12(W),AKNZ12]	;SHOULD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