.TITLE FILE_FRAGMENTATION .IDENT /V01-017/ .SUBTITLE DECLARATIONS ; ; PROGRAM TO SCAN A VAX/VMS FILES-11 LEVEL 2 DISK FILE HEADERS ; AND LIST THE MOST FRAGMENTED FILES FOUND ; ; Michael N. LeVine ; Naval Weapons Center ; Code 3514 ; China Lake ; Ca 93555 ; (619)939-2465 ; AVN 437-2465 ; .ENABLE DEBUG .LIBRARY /SYS$LIBRARY:LIB.MLB/ $HM2DEF ;DECLARE THE STRUCTURE OF THE HOME BLOCK $FH2DEF ;FILE HEADER STRUCTURE $FI2DEF ;IDENT AREA STRUCTURE $FM2DEF ;MAP AREA STRUCTURE $DVIDEF ;DEVICE INFORMATION PARAMETERS AND FLAGS $DCDEF ;DEVICE TYPE FLAGS $RMSDEF ;RMS ERROR CODES MAX_FILE_HEADERS=100 ;MAX NUMBER OF FILES TO KEEP INFO ON FOR OUTPUT HEADER_BUFFER_COUNT=32 ;NO OF FILE HEADERS TO BUFFER ;V01-011 .IF GT HEADER_BUFFER_COUNT-127 ;V01-011 .ERROR ;HEADER BUFFER TOO LARGE ;V01-011 .ENDC .PAGE .SUBTITLE PURE DATA .PSECT PURE_DATA,RD,NOWRT,GBL,CON,QUAD,NOEXE ; ; ARGUMENT LIST FOR LIB$GET_FOREIGN ; GET_ARG: .LONG 4 .ADDRESS DEVICE_NAME .ADDRESS PROMPT .ADDRESS LENGTH .ADDRESS FORCE PROMPT: .ASCID /Device ? / ; ; GETDEV ARGUMENT LIST ; ITEM_LIST: .WORD 4,DVI$_DEVCLASS .ADDRESS CLASS .LONG 0 .WORD 4,DVI$_ACPTYPE .ADDRESS ACPTYPE .LONG 0 .WORD 4,DVI$_MAXBLOCK ;V01-017 .ADDRESS DISK_SIZE ;V01-017 .LONG 0 ;V01-017 .LONG 0 NOT_DISK_ARG: .LONG 1 .ADDRESS NOT_DISK_STRING NOT_DISK_STRING: .ASCID /Specified device is not a disk/ NOT_ODS2_ARG: .LONG 1 .ADDRESS NOT_ODS2_STRING NOT_ODS2_STRING: .ASCID /Specified disk is not structured Files-11 Level 2/ MAIN_HOME_READ_ERROR: .ASCID /Error reading main HOME block/ MAIN_HOME_CKSUM_ERROR: .ASCID /Checksum error in main HOME block/ ALT_HOME_READ_ERROR: .ASCID /Error reading alt. HOME block/ ALT_HOME_CKSUM_ERROR: .ASCID /Checksum error in alt. HOME block/ INDEX_READ_ERROR: .ASCID /Error reading file header in [000000]INDEXF.SYS/ LIST_1: .ASCID /Scan of file headers for the top fragmented files on disk/ STAT_1: .ASCID /File statistics for disk/ LIST_2: .ASCID /# Pointers Size-blocks File name/ LIST_2_FORMAT: .ASCID /!10 !10/ COUNT_FORMAT: .ASCID - ;V01-010 ?Active Files !10UL!/?- ;V01-010 ?Extention headers !10UL!/?- ;V01-010 ?Retrieval pointers !10UL!/?- ;V01-010 ?Placement controls !10UL? ;V01-010 FINAL_MESSAGE_1: ;V01-004 .ASCID /List of files with most retireval pointers/- ;V01-004 / in file FILES.LIS/ ;V01-004 FINAL_MESSAGE_2: ;V01-004 .ASCID /Statistics in file STATS.LIS/ ;V01-004 STATISTICS_HEADER_0: ;V01-017 .ASCID ?File count matrix sorted by file size vs ?- ;V01-017 /number of retrival pointers used/ ;V01-010 STATISTICS_HEADER_1: ;V01-004 .ASCID /File size\ Number of retrival pointers / ;V01-010 STATISTICS_HEADER_2: ;V01-010 .ASCID /(Blocks) \/ ;V01-006 STAT_1_FORMAT: ;V01-004 .ASCID /!6UL+ / ;V01-004 STAT_2_FORMAT: ;V01-004 .ASCID /!6UL / ;V01-004 DIRECTORY_HEADER_0: ;V01-017 .ASCID ?Directory files position count vs (LBN*100)?- ;V01-017 ?/DISK_SIZE ? ;V01-017 DIRECTORY_HEADER_1: ;V01-017 .ASCID ?Location(%) Count? ;V01-017 DIRECTORY_FORMAT: ;V01-017 .ASCID / !3UL% !UL/ ;V01-017 EMPTY_FILE: .ASCID /Zero length file / ;V01-007 EXTENTION_HEADER: .ASCID /Multiple file headers / ;V01-007 PLACEMENT_CONTROL: .ASCID /File has placement control / ;V01-007 FILE_TIME_OUT_PERIOD: .ASCID /366 0:0:0.0/ ;V01-014 OLD_FILE_MESSAGE: .ASCID /File is over 1 year old / ;V01-014 BADACL_MESSAGE: .ASCID /BAD ACL flag set / ;V01-015 BADBLOCK_MESSAGE: .ASCID /BAD BLOCK flag set / ;V01-015 MARKDEL_MESSAGE: .ASCID /MARKED FOR DELETE flag set / ;V01-015 MATCH_BRACKETS: .ASCID /[]/ ;V01-014 MATCH_MFD: .ASCID /[000000]/ ;V01-014 MATCH_SYS0_BKT: .ASCID /[SYS0]/ ;V01-014 MATCH_SYS1_BKT: .ASCID /[SYS1]/ ;V01-014 MATCH_SYS2_BKT: .ASCID /[SYS2]/ ;V01-014 MATCH_SYS3_BKT: .ASCID /[SYS3]/ ;V01-014 MATCH_SYS4_BKT: .ASCID /[SYS4]/ ;V01-014 MATCH_SYS5_BKT: .ASCID /[SYS5]/ ;V01-014 MATCH_SYS6_BKT: .ASCID /[SYS6]/ ;V01-014 MATCH_SYS7_BKT: .ASCID /[SYS7]/ ;V01-014 MATCH_SYS8_BKT: .ASCID /[SYS8]/ ;V01-014 MATCH_SYS9_BKT: .ASCID /[SYS9]/ ;V01-014 MATCH_SYSA_BKT: .ASCID /[SYSA]/ ;V01-014 MATCH_SYSB_BKT: .ASCID /[SYSB]/ ;V01-014 MATCH_SYSC_BKT: .ASCID /[SYSC]/ ;V01-014 MATCH_SYSD_BKT: .ASCID /[SYSD]/ ;V01-014 MATCH_SYSE_BKT: .ASCID /[SYSE]/ ;V01-014 MATCH_SYSF_BKT: .ASCID /[SYSF]/ ;V01-014 MATCH_SYS0_DOT: .ASCID /[SYS0./ ;V01-014 MATCH_SYS1_DOT: .ASCID /[SYS1./ ;V01-014 MATCH_SYS2_DOT: .ASCID /[SYS2./ ;V01-014 MATCH_SYS3_DOT: .ASCID /[SYS3./ ;V01-014 MATCH_SYS4_DOT: .ASCID /[SYS4./ ;V01-014 MATCH_SYS5_DOT: .ASCID /[SYS5./ ;V01-014 MATCH_SYS6_DOT: .ASCID /[SYS6./ ;V01-014 MATCH_SYS7_DOT: .ASCID /[SYS7./ ;V01-014 MATCH_SYS8_DOT: .ASCID /[SYS8./ ;V01-014 MATCH_SYS9_DOT: .ASCID /[SYS9./ ;V01-014 MATCH_SYSA_DOT: .ASCID /[SYSA./ ;V01-014 MATCH_SYSB_DOT: .ASCID /[SYSB./ ;V01-014 MATCH_SYSC_DOT: .ASCID /[SYSC./ ;V01-014 MATCH_SYSD_DOT: .ASCID /[SYSD./ ;V01-014 MATCH_SYSE_DOT: .ASCID /[SYSE./ ;V01-014 MATCH_SYSF_DOT: .ASCID /[SYSF./ ;V01-014 MATCH_SYSEXEMIN: .ASCID /[SYSEXEMIN]/ ;V01-014 MATCH_SYSEXE: .ASCID /[SYSEXE]/ ;V01-014 MATCH_SYSLOST: .ASCID /[SYSLOST]/ ;V01-014 MATCH_SYSMAINT: .ASCID /[SYSMAINT]/ ;V01-014 MATCH_SYSUPD: .ASCID /[SYSUPD]/ ;V01-014 .PAGE .SUBTITLE IMPURE DATA .PSECT IMPURE_DATA,RD,WRT,GBL,CON,QUAD,NOEXE DEVICE_NAME: .ASCID / /;V01-016 LENGTH: .LONG 0 DISK_SIZE: .LONG 0 ;V01-017 OLD_AGE_FLAG: .LONG 0 ;V01-016 FORCE: .LONG 0 CLASS: .LONG 0 ACPTYPE: .LONG 0 IOSB: .LONG 0,0 ; THE FOLLOWING STORAGE AREAS MUST BE QUAD ALIGNED ;V01-011 .ALIGN QUAD ;V01-005 INDEX_BLOCK: .BLKB 512 INDEX_BLOCK_2: .BLKB 512 ;V01-007 LIST_BUFFER: .BLKB 4096 STAT_BUFFER: .BLKB 4096 HEADER_BUFFER: .BLKB ;V01-011 HEADER_BUFFER_FIRST_FID: .LONG 0 ;V01-011 HEADER_BUFFER_HEADER_COUNT: .LONG 0 ;V01-011 FILE_HEADER_1_VBN: .LONG 0 LAST_FILE_HEADER: .LONG 0 DESCRIPTER: .LONG 0,0 MESSAGE_VECTOR: .LONG 0,0,0,0 PLACEMENT_CONTROL_FLAG: .LONG 0 ;V01-007 EXTENTION_HEADER_FLAG: .LONG 0 ;V01-007 FILE_COUNT: .LONG 0 ;V01-008 POINTER_COUNT: .LONG 0 ;V01-008 EXTENTION_COUNT: .LONG 0 ;V01-008 PLACEMENT_COUNT: .LONG 0 ;V01-010 BIN_TIME_OUT: .LONG 0,0 ;V01-014 CURRENT_TIME: .LONG 0,0 ;V01-014 OLD_LIMIT: .LONG 0,0 ;V01-014 TEMP_LIMIT: .LONG 0,0 ;V01-014 TEMP_NAME: ;V01-012 .IF DF FI2$S_FILENAMEXT ;V01-014 .BLKB ;V01-012 .IFF ;V01-014 .BLKB FI2$S_FILENAME ;V01-014 .ENDC ;V01-014 .PAGE ;V01-004 .SUBTITLE STATISTICS SIZE LISTS AND BUFFERS ;V01-004 .PSECT PURE_DATA ;V01-004 ; ;V01-004 ; FIRST ENTRY IN LISTS MUST BE ZERO AND LAST MUST BE -1 ;V01-004 ; ;V01-004 ; EITHER LIST CAN BE MODIFIED JUST BY ADDING,DELTEING ;V01-004 ; AND/OR CHANGEING ENTRIES IN EITHER OR BOTH LISTS. ;V01-004 ; THE CODE FOR INSTRUCTIONS AND DATA AREAS HANDLE THE ;V01-004 ; CHANGES. THE ONLY LIMITATION BEING THAT ONE LINE CAN ;V01-004 ; HOLD NO MORE THAN 4096 CHAR'S ;V01-004 ; ;V01-004 FILE_SIZE_LIST: ;V01-004 .LONG 0,1,5,10,25,50,75,100,250,500,750,1000 ;V01-004 .LONG 10000,100000,-1 ;V01-004 FILE_SIZE_COUNT=<<<.-FILE_SIZE_LIST>/4>-1> ;V01-004 POINTER_COUNT_LIST: ;V01-004 .LONG 0,1,2,8,50,100,1000,-1 ;V01-006 POINTER_SIZE_COUNT=<<<.-POINTER_COUNT_LIST>/4>-1> ;V01-004 .PSECT STATS,RD,WRT ;V01-004 STATISTICS: ;V01-004 .BLKL ;V01-004 DIRECTORY_MAP: ;V01-017 .BLKL 100 ;V01-017 DIRECTORY_FLAG: .LONG 0 ;V01-017 .PAGE .SUBTITLE LIST OF FILES WITH MOST RETRIVAL POINTERS .PSECT ARRAY,RD,WRT,GBL,CON,QUAD,NOEXE ; ; LIST OF ELEMENTS POINTING TO FILE HEADERS WITH MOST RETRIVAL POINTERS ; ; ------------ ; ! ! 0 NUMBER OF RETRIVAL POINTERS ; ------------ ; ! ! 4 SIZE OF FILE IN BLOCKS ; ------------ ; ! ! 8 SEQUENCE NUMBER OF FILE HEADER ; ------------ ; COUNT_L_POINTERS=0 COUNT_L_SIZE=4 COUNT_L_SEQUENCE=8 COUNT_SIZE=12 COUNT_ARRAY: .BLKB SEQUENCE: .LONG 0 POINTERS: .LONG 0 SIZE: .LONG 0 COUNT: .LONG 0 TEMP_SEQUENCE: .LONG 0 ;V01-007 .PAGE .SUBTITLE RMS BLOCKS .PSECT RMS_DATA,RD,WRT,GBL,CON,QUAD,NOEXE .ALIGN LONG INDEX_FAB: $FAB ALQ=0,- DEQ=0,- DNM=,- FAC=,- FNA=,FNS=0,- SHR= .ALIGN LONG INDEX_RAB: $RAB BKT=1,- FAB=INDEX_FAB,- RBF=INDEX_BLOCK,RSZ=512- ROP=,- UBF=INDEX_BLOCK,USZ=512 LIST_FAB: $FAB ALQ=15,- ;V01-003 DEQ=5,- ;V01-003 DNM=,- FAC=,- FOP=,- ORG=,- RAT=,- RFM=,- SHR= LIST_RAB: $RAB FAB=LIST_FAB,- BKT=0,- RAC=,- RBF=LIST_BUFFER,- RSZ=0 STAT_FAB: ;V01-004 $FAB ALQ=5,- ;V01-004 DEQ=5,- ;V01-004 DNM=,- ;V01-004 FAC=,- ;V01-004 FOP=,- ;V01-004 ORG=,- ;V01-004 RAT=,- ;V01-004 RFM=,- ;V01-004 SHR= ;V01-004 STAT_RAB: ;V01-004 $RAB FAB=STAT_FAB,- ;V01-004 BKT=0,- ;V01-004 RAC=,- ;V01-004 RBF=STAT_BUFFER,- ;V01-004 RSZ=0 ;V01-004 .PAGE .SUBTITLE CODE .SUBTITLE INITALIZATION .PSECT CODE,RD,NOWRT,EXE,GBL,CON .ENTRY FILE_CHECK,0 ; ;V01-014 ; INIT THE TIME OUT STUFF ;V01-014 ; ;V01-014 PUSHAL CURRENT_TIME ;V01-014 CALLS #1,G^SYS$GETTIM ;V01-014 PUSHAL BIN_TIME_OUT ;V01-014 PUSHAL FILE_TIME_OUT_PERIOD ;V01-014 CALLS #2,G^SYS$BINTIM ;V01-014 MOVQ CURRENT_TIME,OLD_LIMIT ;V01-014 ADDL2 BIN_TIME_OUT,OLD_LIMIT ;V01-014 ADWC BIN_TIME_OUT+4,OLD_LIMIT+4 ;V01-014 CLRL OLD_AGE_FLAG ;V01-016 ; ; GET THE DEVICE NAME ; CALLG GET_ARG,G^LIB$GET_FOREIGN BLBS R0,1$ $EXIT_S R0 1$: LOCC #^A?/?,LENGTH,DEVICE_NAME+8 ;V01-016 BNEQ 30$ ;V01-016 SUBL2 R0,LENGTH ;V01-016 CMPB #^A/A/,1(R1) ;V01-016 BNEQ 30$ ;V01-016 MOVL #1,OLD_AGE_FLAG ;V01-016 30$: MOVL LENGTH,DEVICE_NAME ;V01-016 ; ; GET INFORMATION ON SPECIFIED DEVICE ; $GETDVIW_S #1,,DEVICE_NAME,ITEM_LIST,IOSB ;V01-017 BLBS R0,2$ $EXIT_S R0 2$: $WAITFR_S #1 BLBS IOSB,3$ CVTWL IOSB,R0 $EXIT_S R0 ; MUST BE A DISK 3$: CMPL #DC$_DISK,CLASS BEQL 4$ CALLG NOT_DISK_ARG,G^LIB$PUT_OUTPUT $EXIT_S ; MUST BE ODS-2 4$: CMPL #DVI$C_ACP_F11V2,ACPTYPE BEQL 5$ CALLG NOT_ODS2_ARG,G^LIB$PUT_OUTPUT $EXIT_S 5$:; ; OPEN THE INDEXF.SYS FILE ; MOVB LENGTH,INDEX_FAB+FAB$B_FNS $OPEN FAB=INDEX_FAB BLBS R0,6$ $EXIT_S R0 6$: $CONNECT RAB=INDEX_RAB BLBS R0,7$ $EXIT_S R0 7$: ; ;V01-007 ; OPEN OUTPUT FILES ;V01-007 ; ;V01-007 $CREATE FAB=STAT_FAB ;V01-004 BLBS R0,9$ ;V01-007 $EXIT_S ;V01-007 9$: $CONNECT RAB=STAT_RAB ;V01-007 BLBS R0,10$ ;V01-007 $EXIT_S R0 ;V01-004 10$: $CREATE FAB=LIST_FAB ;V01-007 BLBS R0,11$ ;V01-007 $EXIT_S R0 11$: $CONNECT RAB=LIST_RAB BLBS R0,12$ ;V01-007 $EXIT_S R0 12$: ; ; PUT OUT INITIAL HEADER INFO ; MOVL LIST_1+4,LIST_RAB+RAB$L_RBF ;V01-007 MOVZBW LIST_1,LIST_RAB+RAB$W_RSZ $PUT RAB=LIST_RAB MOVL STAT_1+4,STAT_RAB+RAB$L_RBF ;V01-004 MOVZBW STAT_1,STAT_RAB+RAB$W_RSZ ;V01-004 $PUT RAB=STAT_RAB ;V01-004 ; DEVICE NAME MOVL DEVICE_NAME+4,LIST_RAB+RAB$L_RBF MOVZBW DEVICE_NAME,LIST_RAB+RAB$W_RSZ $PUT RAB=LIST_RAB MOVL DEVICE_NAME+4,STAT_RAB+RAB$L_RBF ;V01-004 MOVZBW DEVICE_NAME,STAT_RAB+RAB$W_RSZ ;V01-004 $PUT RAB=STAT_RAB ;V01-004 ; DATE TIME MOVL #30,DESCRIPTER MOVAL LIST_BUFFER,DESCRIPTER+4 PUSHAL DESCRIPTER CALLS #1,G^LIB$DATE_TIME MOVL #30,LIST_RAB+RAB$W_RSZ MOVAL LIST_BUFFER,LIST_RAB+RAB$L_RBF $PUT RAB=LIST_RAB MOVL #30,STAT_RAB+RAB$W_RSZ ;V01-004 MOVAL LIST_BUFFER,STAT_RAB+RAB$L_RBF ;V01-004 $PUT RAB=STAT_RAB ;V01-004 ; OUTPUT A BLANK LINE MOVAL LIST_BUFFER,LIST_RAB+RAB$L_RBF MOVW #1,LIST_RAB+RAB$W_RSZ MOVB #^A/ /,LIST_BUFFER $PUT RAB=LIST_RAB MOVAL LIST_BUFFER,STAT_RAB+RAB$L_RBF ;V01-004 MOVW #1,STAT_RAB+RAB$W_RSZ ;V01-004 $PUT RAB=STAT_RAB ;V01-004 ; ; GET THE CURRENT HOME BLOCK FOR INFO ON START OF FILE HEADERS ; MOVL #2,INDEX_RAB+RAB$L_BKT ;GET INITIAL HOME BLOCK MOVAL INDEX_BLOCK,INDEX_RAB+RAB$L_UBF ;V01-007 MOVW #512,INDEX_RAB+RAB$W_USZ ;V01-011 $READ RAB=INDEX_RAB BLBS R0,13$ ;ERROR READING MAIN HOME BLOCK PUSHAL INDEX_RAB+RAB$L_STV PUSHAL INDEX_RAB+RAB$L_STS PUSHAL MAIN_HOME_READ_ERROR CALLS #3,SYSTEM_ERROR_MESSAGE BRW 14$ 13$: ;CHECK CHECKSUMS CLRL R0 MOVL #,R1 MOVAL INDEX_BLOCK,R2 15$: ADDW2 (R2)+,R0 SOBGTR R1,15$ CMPW R0,(R2) BNEQ 16$ ;BRANCH IF CHECKSUM1 DOES NOT MATCH CLRL R0 MOVL #,R1 MOVAL INDEX_BLOCK,R2 17$: ADDW2 (R2)+,R0 SOBGTR R1,17$ CMPW R0,(R2) BNEQ 16$ ;BRANCH IF CHECKSUM2 DOES NOT MATCH BRW 18$ ;CHECKSUMMS OK-CONTINUE 16$: PUSHAL MAIN_HOME_CKSUM_ERROR ;CHECKSUM ERROR-MESSAGE OUTPUT CALLS #1,G^LIB$PUT_OUTPUT 14$: ;ATTEMPT TO GET ALT HOME BLOCK MOVL #3,INDEX_RAB+RAB$L_BKT ;GET ALT HOME BLOCK MOVAL INDEX_BLOCK,INDEX_RAB+RAB$L_UBF ;V01-007 MOVW #512,INDEX_RAB+RAB$W_USZ ;V01-011 $READ RAB=INDEX_RAB BLBS R0,23$ ;ERROR READING ALT HOME BLOCK PUSHAL INDEX_RAB+RAB$L_STV PUSHAL INDEX_RAB+RAB$L_STS PUSHAL ALT_HOME_READ_ERROR CALLS #3,SYSTEM_ERROR_MESSAGE $EXIT_S 23$: ;CHECK CHECKSUMS CLRL R0 MOVL #,R1 MOVAL INDEX_BLOCK,R2 25$: ADDW2 (R2)+,R0 SOBGTR R1,25$ CMPW R0,(R2) BNEQ 26$ ;BRANCH IF CHECKSUM 1 ERROR CLRL R0 MOVL #,R1 MOVAL INDEX_BLOCK,R2 27$: ADDW2 (R2)+,R0 SOBGTR R1,27$ CMPW R0,(R2) BEQL 18$ ;BRANCH IF CHECKSUM 2 OK 26$: PUSHAL ALT_HOME_CKSUM_ERROR ;BOTH HOME BLOCKS BAD CALLS #1,G^LIB$PUT_OUTPUT ;MESSAGE AND EXIT $EXIT_S ; ; INITALIZE INTERNAL DATA AREAS ; 18$: CVTWL INDEX_BLOCK+HM2$W_IBMAPVBN,R0 ;GET STARTING VBN AND SIZE OF CVTWL INDEX_BLOCK+HM2$W_IBMAPSIZE,R1 ;FILE HEADER BITMAP ADDL3 R1,R0,FILE_HEADER_1_VBN ;INIT 1ST FILE HEADER;V01-007 CLRL LAST_FILE_HEADER CLRL FILE_COUNT ;V01-008 CLRL POINTER_COUNT ;V01-008 CLRL EXTENTION_COUNT ;V01-008 CLRL PLACEMENT_COUNT ;V01-010 MOVC5 #0,COUNT_ARRAY,#0,#,COUNT_ARRAY MOVC5 #0,STATISTICS,#0,- ;V01-004 #<4*POINTER_SIZE_COUNT*FILE_SIZE_COUNT>,STATISTICS;V01-004 CLRL HEADER_BUFFER_HEADER_COUNT ;V01-011 CLRL HEADER_BUFFER_FIRST_FID ;V01-011 MOVC5 #0,HEADER_BUFFER,#0,#,-;V01-011 HEADER_BUFFER ;V01-011 MOVC5 #0,DIRECTORY_MAP,#0,#<100*4>,DIRECTORY_MAP ;V01-017 .PAGE .SUBTITLE SCAN FILE HEADER LOOP-GET FILE HEADER LOOP: INCL LAST_FILE_HEADER PUSHAL INDEX_BLOCK ;V01-011 PUSHAL LAST_FILE_HEADER ;V01-011 CALLS #2,READ_HEADER ;V01-011 BLBS R0,4$ BRW END_LOOP ;CAN ONLY BE EOF-DONE ;V01-011 4$:; ; CONFIRM IT IS A VALID FILE HEADER ; ; CHECKS BASED ON THOSE USED BY DUMP-CODE ADAPTED FROM THAT READ ; IN SOURCE FICHE. ; CLRL DIRECTORY_FLAG ;V01-017 MOVAL INDEX_BLOCK,R0 ;CHECK CHECKSUM CLRL R1 MOVL #,R2 6$: ADDW2 (R0)+,R1 SOBGTR R2,6$ CMPW R1,(R0) BEQL 7$ BRW LOOP ;BAD CHECKSUM 7$: CMPB INDEX_BLOCK+FH2$B_STRUCLEV,#2;CHECK STRUCTURE LEVEL BEQL 8$ BRW LOOP ;BAD STRUCTURE ; ; CHECK OFFSETS INTO HEADER ; 8$:; CMPB INDEX_BLOCK+FH2$B_IDOFFSET,# ; BLSSU 9$ CMPB INDEX_BLOCK+FH2$B_MPOFFSET,INDEX_BLOCK+FH2$B_IDOFFSET BLSSU 9$ CMPB INDEX_BLOCK+FH2$B_ACOFFSET,INDEX_BLOCK+FH2$B_MPOFFSET BLSSU 9$ CMPB INDEX_BLOCK+FH2$B_RSOFFSET,INDEX_BLOCK+FH2$B_ACOFFSET BLSSU 9$ SUBB3 INDEX_BLOCK+FH2$B_MPOFFSET,INDEX_BLOCK+FH2$B_ACOFFSET,R0 CMPB INDEX_BLOCK+FH2$B_MAP_INUSE,R0 BGTRU 9$ ; ; SEE IF HEADER IN USE ; TSTW INDEX_BLOCK+FH2$W_FID_NUM BNEQ 10$ TSTB INDEX_BLOCK+FH2$B_FID_NMX BNEQ 10$ 9$: BRW LOOP 10$: ; ; ALSO MUST NOT BE AN EXTENTION FILE HEADER ; TSTW INDEX_BLOCK+FH2$W_SEG_NUM BEQL 11$ BRW LOOP 11$: ; ; INIT COUNTERS AND POINTERS ; MOVW INDEX_BLOCK+FH2$W_FID_NUM,SEQUENCE MOVZBW INDEX_BLOCK+FH2$B_FID_NMX,SEQUENCE+2 INCL FILE_COUNT ;V01-008 CLRL POINTERS CLRL SIZE CLRL EXTENTION_HEADER_FLAG ;V01-007 CLRL PLACEMENT_CONTROL_FLAG ;V01-007 ; ;V01-014 ; CHECK FOR OLD FILES ;V01-014 ; ;V01-014 TSTL OLD_AGE_FLAG ;V01-016 BNEQ 21$ ;V01-016 BRW 12$ ;V01-016 21$: ;V01-016 MOVZBL INDEX_BLOCK+FH2$B_IDOFFSET,R0 ;ID AREA OFFSET ;V01-014 MULL2 #2,R0 ;V01-014 MOVQ INDEX_BLOCK+FI2$Q_CREDATE(R0),TEMP_LIMIT ;V01-014 SUBL2 OLD_LIMIT,TEMP_LIMIT ;V01-014 SBWC OLD_LIMIT+4,TEMP_LIMIT+4 ;V01-014 BLEQ 13$ ;V01-014 BRW 12$ ;V01-014 13$: MOVAL STAT_BUFFER,DESCRIPTER+4 ;V01-014 MOVZBL OLD_FILE_MESSAGE,R0 ;V01-014 MOVL R0,DESCRIPTER ;V01-014 MOVC3 R0,@OLD_FILE_MESSAGE+4,STAT_BUFFER ;V01-014 PUSHAL DESCRIPTER ;V01-014 PUSHAL SEQUENCE ;V01-014 CALLS #2,FILE_NAME ;V01-014 MOVZBL DESCRIPTER,R4 ;V01-014 MOVL DESCRIPTER+4,R5 ;V01-014 .MACRO CHK DESC,?A ;V01-014 MOVZBL DESC,R0 ;V01-014 MATCHC R0,@DESC+4,R4,(R5) ;V01-014 BNEQ A ;V01-014 BRW 12$ ;V01-014 A: ;V01-014 .ENDM ;V01-014 CHK MATCH_BRACKETS ;V01-014 CHK MATCH_MFD ;V01-014 CHK MATCH_SYS0_DOT ;V01-014 CHK MATCH_SYS0_BKT ;V01-014 CHK MATCH_SYS1_DOT ;V01-014 CHK MATCH_SYS1_BKT ;V01-014 CHK MATCH_SYS2_DOT ;V01-014 CHK MATCH_SYS2_BKT ;V01-014 CHK MATCH_SYS3_DOT ;V01-014 CHK MATCH_SYS3_BKT ;V01-014 CHK MATCH_SYS4_DOT ;V01-014 CHK MATCH_SYS4_BKT ;V01-014 CHK MATCH_SYS5_DOT ;V01-014 CHK MATCH_SYS5_BKT ;V01-014 CHK MATCH_SYS6_DOT ;V01-014 CHK MATCH_SYS6_BKT ;V01-014 CHK MATCH_SYS7_DOT ;V01-014 CHK MATCH_SYS7_BKT ;V01-014 CHK MATCH_SYS8_DOT ;V01-014 CHK MATCH_SYS8_BKT ;V01-014 CHK MATCH_SYS9_DOT ;V01-014 CHK MATCH_SYS9_BKT ;V01-014 CHK MATCH_SYSA_DOT ;V01-014 CHK MATCH_SYSA_BKT ;V01-014 CHK MATCH_SYSB_DOT ;V01-014 CHK MATCH_SYSB_BKT ;V01-014 CHK MATCH_SYSC_DOT ;V01-014 CHK MATCH_SYSC_BKT ;V01-014 CHK MATCH_SYSD_DOT ;V01-014 CHK MATCH_SYSD_BKT ;V01-014 CHK MATCH_SYSE_DOT ;V01-014 CHK MATCH_SYSE_BKT ;V01-014 CHK MATCH_SYSF_DOT ;V01-014 CHK MATCH_SYSF_BKT ;V01-014 CHK MATCH_SYSEXEMIN ;V01-014 CHK MATCH_SYSEXE ;V01-014 CHK MATCH_SYSLOST ;V01-014 CHK MATCH_SYSMAINT ;V01-014 CHK MATCH_SYSUPD ;V01-014 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-014 MOVZBW DESCRIPTER,STAT_RAB+RAB$W_RSZ ;V01-014 $PUT RAB=STAT_RAB ;V01-014 12$: ;V01-014 .PAGE .SUBTITLE SCAN FILE HEADER LOOP-SCAN FILE HEADER INCL ANY EXT OUTTER_COUNT_LOOP: ; ;V01-015 ; CHECK FOR BAD SOMETHING FLAGS ;V01-015 ; ;V01-015 BITL #FH2$M_BADACL,INDEX_BLOCK+FH2$L_FILECHAR ;V01-015 BEQL 1$ ;V01-015 MOVAL STAT_BUFFER,DESCRIPTER+4 ;V01-015 MOVZBL BADACL_MESSAGE,R0 ;V01-015 MOVL R0,DESCRIPTER ;V01-015 MOVC3 R0,@BADACL_MESSAGE+4,STAT_BUFFER ;V01-015 PUSHAL DESCRIPTER ;V01-015 PUSHAL SEQUENCE ;V01-015 CALLS #2,FILE_NAME ;V01-015 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-015 MOVZBW DESCRIPTER,STAT_RAB+RAB$W_RSZ ;V01-015 $PUT RAB=STAT_RAB ;V01-015 PUSHAL DESCRIPTER ;V01-015 CALLS #1,G^LIB$PUT_OUTPUT ;V01-015 1$: BITL #FH2$M_BADBLOCK,INDEX_BLOCK+FH2$L_FILECHAR ;V01-015 BEQL 2$ ;V01-015 MOVAL STAT_BUFFER,DESCRIPTER+4 ;V01-015 MOVZBL BADBLOCK_MESSAGE,R0 ;V01-015 MOVL R0,DESCRIPTER ;V01-015 MOVC3 R0,@BADBLOCK_MESSAGE+4,STAT_BUFFER ;V01-015 PUSHAL DESCRIPTER ;V01-015 PUSHAL SEQUENCE ;V01-015 CALLS #2,FILE_NAME ;V01-015 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-015 MOVZBW DESCRIPTER,STAT_RAB+RAB$W_RSZ ;V01-015 $PUT RAB=STAT_RAB ;V01-015 PUSHAL DESCRIPTER ;V01-015 CALLS #1,G^LIB$PUT_OUTPUT ;V01-015 2$: BITL #FH2$M_MARKDEL,INDEX_BLOCK+FH2$L_FILECHAR ;V01-015 BEQL 3$ ;V01-015 MOVAL STAT_BUFFER,DESCRIPTER+4 ;V01-015 MOVZBL MARKDEL_MESSAGE,R0 ;V01-015 MOVL R0,DESCRIPTER ;V01-015 MOVC3 R0,@MARKDEL_MESSAGE+4,STAT_BUFFER ;V01-015 PUSHAL DESCRIPTER ;V01-015 PUSHAL SEQUENCE ;V01-015 CALLS #2,FILE_NAME ;V01-015 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-015 MOVZBW DESCRIPTER,STAT_RAB+RAB$W_RSZ ;V01-015 $PUT RAB=STAT_RAB ;V01-015 PUSHAL DESCRIPTER ;V01-015 CALLS #1,G^LIB$PUT_OUTPUT ;V01-015 3$: ;V01-015 BITL #FH2$M_DIRECTORY,INDEX_BLOCK+FH2$L_FILECHAR ;V01-017 BEQL 4$ ;V01-017 MOVL #1,DIRECTORY_FLAG ;V01-017 4$: ;V01-017 MOVZBL INDEX_BLOCK+FH2$B_MPOFFSET,R11 MULL2 #2,R11 MOVZBL INDEX_BLOCK+FH2$B_MAP_INUSE,R10 MULL2 #2,R10 ADDL2 R11,R10 INNER_COUNT_LOOP: CMPL R11,R10 BLSS 31$ BRW 40$ ; ; EXTRACT FORMAT FIELD ; 31$: EXTZV #FM2$V_FORMAT,#FM2$S_FORMAT,INDEX_BLOCK(R11),R9 ; ; IS IT PLACEMENT CONTROL ; CMPB #FM2$C_PLACEMENT,R9 BNEQ 32$ ;NO ; ; PLACEMENT CONTROL DOES NOT COUNT ; ADDL2 #2,R11 INCL PLACEMENT_COUNT ;V01-010 TSTL PLACEMENT_CONTROL_FLAG ;V01-007 BNEQ 20$ ;V01-007 MOVAL STAT_BUFFER,DESCRIPTER+4 ;V01-007 MOVZBL PLACEMENT_CONTROL,R0 ;V01-007 MOVL R0,DESCRIPTER ;V01-007 MOVC3 R0,@PLACEMENT_CONTROL+4,STAT_BUFFER ;V01-007 PUSHAL DESCRIPTER ;V01-007 PUSHAL SEQUENCE ;V01-007 CALLS #2,FILE_NAME ;V01-007 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-007 MOVZBW DESCRIPTER,STAT_RAB+RAB$W_RSZ ;V01-007 $PUT RAB=STAT_RAB ;V01-007 MOVL #1,PLACEMENT_CONTROL_FLAG ;V01-007 20$: BRW 39$ ;V01-007 ; ; IS IT FORMAT 1 ; 32$: CMPB #FM2$C_FORMAT1,R9 BNEQ 33$ ; ; EXTRACT COUNT ; AND UPDATE OFFSET TO NEXT PTR. ; MOVZBL INDEX_BLOCK+FM2$B_COUNT1(R11),R0 INCL POINTERS ADDL2 R0,SIZE INCL SIZE TSTL DIRECTORY_FLAG ;V01-017 BEQL 1032$ ;V01-017 MOVZWL INDEX_BLOCK+FM2$W_LOWLBN(R11),DIRECTORY_FLAG ;V01-017 EXTZV #FM2$V_HIGHLBN,#FM2$S_HIGHLBN,INDEX_BLOCK(R11),R0;V01-017 MOVW R0,DIRECTORY_FLAG+2 ;V01-017 1032$: ;V01-017 ADDL2 #4,R11 BRB 39$ ; ; IS IT FORMAT 2 ; 33$: CMPB #FM2$C_FORMAT2,R9 BNEQ 34$ ;NO ; ; EXTRACT COUNT ; AND UPDATE OFFSET TO NEXT PTR. ; EXTZV #FM2$V_COUNT2,#FM2$S_COUNT2,INDEX_BLOCK(R11),R0 ADDL2 R0,SIZE INCL SIZE INCL POINTERS TSTL DIRECTORY_FLAG ;V01-017 BEQL 1033$ ;V01-017 MOVL INDEX_BLOCK+FM2$L_LBN2(R11),DIRECTORY_FLAG ;V01-017 1033$: ;V01-017 ADDL2 #6,R11 BRB 39$ ; ; CAN ONLY BE FORMAT 3 ; 34$: CMPB #FM2$C_FORMAT3,R9 BNEQ 35$ ;OOP'S NOT 3 EITHER ; ; EXTRACT COUNT ; AND UPDATE OFFSET TO NEXT PTR. ; ROTL #16,INDEX_BLOCK(R11),R0 EXTZV #0,#30,R0,R1 ADDL2 R1,SIZE INCL SIZE INCL POINTERS TSTL DIRECTORY_FLAG ;V01-017 BEQL 1034$ ;V01-017 MOVL INDEX_BLOCK+FM2$L_LBN3(R11),DIRECTORY_FLAG ;V01-017 1034$: ;V01-017 ADDL2 #8,R11 BRB 39$ 35$: ; ;BAD FORMAT-FORGET THE WHOLE FILE HEADER ; BRW LOOP 39$: INCL POINTER_COUNT ;V01-008 TSTL DIRECTORY_FLAG ;V01-017 BEQL 1039$ ;V01-017 CMPL #1,DIRECTORY_FLAG ;V01-017 BEQL 1039$ ;V01-017 MULL2 #20,DIRECTORY_FLAG ;V01-017 DIVL3 DISK_SIZE,DIRECTORY_FLAG,R0 ;V01-017 INCL DIRECTORY_MAP[R0] ;V01-017 1039$: ;V01-017 BRW INNER_COUNT_LOOP ;V01-008 ; ; THIS HEADER USED UP-SEE IF THERE IS AN EXTENTION HEADER FOR THIS ; FILE ; 40$: MOVW INDEX_BLOCK+FH2$W_EX_FIDNUM,COUNT MOVZBW INDEX_BLOCK+FH2$B_EX_FIDNMX,COUNT+2 TSTL COUNT BNEQ 41$ ;YES THERE IS AN EXTENTION HEADER FOR THIS FILE BRW END_COUNT_LOOP ;NO-SEE IF FILE FITS IN LIST ; ; CALCULATE VBN AND READ IN EXTENTION HEADER FOR THIS FILE ; 41$: TSTL EXTENTION_HEADER_FLAG ;V01-007 BNEQ 25$ ;V01-007 MOVAL STAT_BUFFER,DESCRIPTER+4 ;V01-007 MOVZBL EXTENTION_HEADER,R0 ;V01-007 MOVL R0,DESCRIPTER ;V01-007 MOVC3 R0,@EXTENTION_HEADER+4,STAT_BUFFER ;V01-007 PUSHAL DESCRIPTER ;V01-007 PUSHAL SEQUENCE ;V01-007 CALLS #2,FILE_NAME ;V01-007 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-007 MOVZBW DESCRIPTER,STAT_RAB+RAB$W_RSZ ;V01-007 $PUT RAB=STAT_RAB ;V01-007 MOVL #1,EXTENTION_HEADER_FLAG ;V01-007 25$: INCL EXTENTION_COUNT ;V01-008 ADDL3 FILE_HEADER_1_VBN,COUNT,R0 ;V01-008 SUBL3 #1,R0,INDEX_RAB+RAB$L_BKT MOVAL INDEX_BLOCK,INDEX_RAB+RAB$L_UBF ;V01-007 MOVW #512,INDEX_RAB+RAB$W_USZ ;V01-011 $READ RAB=INDEX_RAB BLBS R0,44$ PUSHAL INDEX_RAB+RAB$L_STV PUSHAL INDEX_RAB+RAB$L_STS PUSHAL INDEX_READ_ERROR CALLS #3,SYSTEM_ERROR_MESSAGE $EXIT_S 44$: ; ; CONFIRM IT IS A VALID FILE HEADER ; MOVAL INDEX_BLOCK,R0 ;CHECKSUM CLRL R1 MOVL #,R2 46$: ADDW2 (R0)+,R1 SOBGTR R2,46$ CMPW R1,(R0) BEQL 47$ BRW END_COUNT_LOOP 47$: CMPB INDEX_BLOCK+FH2$B_STRUCLEV,#2 ;STRUCTURE LEVEL BEQL 48$ BRW END_COUNT_LOOP ; ; OFFSETS ; 48$:; CMPB INDEX_BLOCK+FH2$B_IDOFFSET,# ; BLSSU 49$ CMPB INDEX_BLOCK+FH2$B_MPOFFSET,INDEX_BLOCK+FH2$B_IDOFFSET BLSSU 49$ CMPB INDEX_BLOCK+FH2$B_ACOFFSET,INDEX_BLOCK+FH2$B_MPOFFSET BLSSU 49$ CMPB INDEX_BLOCK+FH2$B_RSOFFSET,INDEX_BLOCK+FH2$B_ACOFFSET BLSSU 49$ SUBB3 INDEX_BLOCK+FH2$B_MPOFFSET,INDEX_BLOCK+FH2$B_ACOFFSET,R0 CMPB INDEX_BLOCK+FH2$B_MAP_INUSE(R11),R0 BGTRU 49$ ; ; MAKE SURE IN USE ; TSTW INDEX_BLOCK+FH2$W_FID_NUM BNEQ 42$ TSTB INDEX_BLOCK+FH2$B_FID_NMX BNEQ 42$ 49$: BRW END_COUNT_LOOP 42$: ; ; ALSO MUST BE AN EXTENTION FILE HEADER ; TSTW INDEX_BLOCK+FH2$W_SEG_NUM BNEQ 43$ BRW END_COUNT_LOOP 43$: BRW OUTTER_COUNT_LOOP ;CONTINUE SCANNING RETRIVAL POINTERS .PAGE .SUBTITLE SCAN FILE HEADER LOOP-PUT IN ARRAY IF POSSABLE END_COUNT_LOOP: TSTL SIZE ;V01-007 BNEQ 5$ ;V01-007 MOVAL STAT_BUFFER,DESCRIPTER+4 ;V01-007 MOVZBL EMPTY_FILE,R0 ;V01-007 MOVL R0,DESCRIPTER ;V01-007 MOVC3 R0,@EMPTY_FILE+4,STAT_BUFFER ;V01-007 PUSHAL DESCRIPTER ;V01-007 PUSHAL SEQUENCE ;V01-007 CALLS #2,FILE_NAME ;V01-007 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-007 MOVZBW DESCRIPTER,STAT_RAB+RAB$W_RSZ ;V01-007 $PUT RAB=STAT_RAB ;V01-007 5$: ;V01-007 ; ;V01-004 ; PUT IN STATISTICS BUFFER ;V01-004 ; ;V01-004 CLRL R11 ;V01-004 1$: CMPL FILE_SIZE_LIST+4[R11],SIZE ;V01-004 BGTRU 2$ ;V01-004 INCL R11 ;V01-004 BRB 1$ ;V01-004 2$: MULL2 #POINTER_SIZE_COUNT,R11 ;V01-004 CLRL R10 ;V01-004 3$: CMPL POINTER_COUNT_LIST+4[R10],POINTERS ;V01-004 BGTRU 4$ ;V01-004 INCL R11 ;V01-004 INCL R10 ;V01-004 BRB 3$ ;V01-004 4$: INCL STATISTICS[R11] ;V01-004 MOVAL COUNT_ARRAY,R11 MOVL #MAX_FILE_HEADERS,R10 CHECK_LOOP: CMPL POINTERS,COUNT_L_POINTERS(R11) BGEQ FOUND_SLOT ADDL2 #COUNT_SIZE,R11 SOBGTR R10,CHECK_LOOP ; ; NO SLOT FOUND-JUST FORGET THIS ONE-NOT FRAGMENTED ENOUGH ; BRW LOOP FOUND_SLOT: ; ; CALC HOW MUCH STUFF TO SLIDE DOWN THE ARRAY ; DECL R10 BEQL 1$ ;THIS IS THE LAST SLOT MULL2 #COUNT_SIZE,R10 ;GET NUMBER OF BYTES TO MOVE MOVC3 R10,(R11),COUNT_SIZE(R11) ;SLIDE ALL DOWN 1 SLOT 1$: MOVL SEQUENCE,COUNT_L_SEQUENCE(R11) MOVL POINTERS,COUNT_L_POINTERS(R11) MOVL SIZE,COUNT_L_SIZE(R11) BRW LOOP .PAGE .SUBTITLE SET UP FOR OUTPUT OF RESULTS ;V01-007 END_LOOP: ; ; OUTPUT A BLANK LINE ; MOVAL LIST_BUFFER,LIST_RAB+RAB$L_RBF MOVW #1,LIST_RAB+RAB$W_RSZ MOVB #^A/ /,LIST_BUFFER $PUT RAB=LIST_RAB MOVAL LIST_BUFFER,STAT_RAB+RAB$L_RBF ;V01-004 MOVW #1,STAT_RAB+RAB$W_RSZ ;V01-004 $PUT RAB=STAT_RAB ;V01-004 ; ;V01-008 ; FILE/POINTER STATS ;V01-008 ; ;V01-008 PUSHL PLACEMENT_COUNT ;V01-010 PUSHL POINTER_COUNT ;V01-008 PUSHL EXTENTION_COUNT ;V01-008 PUSHL FILE_COUNT ;V01-008 MOVAL STAT_BUFFER,DESCRIPTER+4 ;V01-008 MOVL #200,DESCRIPTER ;V01-010 PUSHAL DESCRIPTER ;V01-008 PUSHAL DESCRIPTER ;V01-008 PUSHAL COUNT_FORMAT ;V01-008 CALLS #6,G^SYS$FAO ;V01-008 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-008 MOVL DESCRIPTER,STAT_RAB+RAB$W_RSZ ;V01-008 $PUT RAB=STAT_RAB ;V01-008 MOVAL LIST_BUFFER,STAT_RAB+RAB$L_RBF ;V01-008 MOVW #1,STAT_RAB+RAB$W_RSZ ;V01-008 MOVB #^A/ /,LIST_BUFFER ;V01-011 $PUT RAB=STAT_RAB ;V01-008 ; ; AND THE COLLUMN HEADERS ; MOVL LIST_2+4,LIST_RAB+RAB$L_RBF MOVZBW LIST_2,LIST_RAB+RAB$W_RSZ $PUT RAB=LIST_RAB MOVAL COUNT_ARRAY,R11 MOVL #MAX_FILE_HEADERS,R10 .PAGE .SUBTITLE OUTPUT LOOP FOR HIGH FRAGMENTATION FILES OUTPUT_LOOP: ; ; SEE IF LIST IS SHORT ; TSTL COUNT_L_POINTERS(R11) BNEQ 1$ BRW END_OUTPUT_LOOP ; ; CLEAR THE BUFFER ; 1$: MOVC5 #0,LIST_BUFFER,#^A/ /,#4096,LIST_BUFFER ; ; FILL IN NO OF POINTERS AND SIZE IN BLOCKS ; CMPL #1,COUNT_L_POINTERS(R11);ONE POINTER FILES-IGNORE;V01-003 BLSS 3$ ;V01-003 BRW END_OUTPUT_LOOP ;V01-003 3$: MOVL #26,DESCRIPTER ;V01-003 MOVAL LIST_BUFFER,DESCRIPTER+4 PUSHL COUNT_L_SIZE(R11) PUSHL COUNT_L_POINTERS(R11) PUSHAL DESCRIPTER PUSHAL LENGTH PUSHAL LIST_2_FORMAT CALLS #5,G^SYS$FAO ; ;V01-007 ; FILL IN EMPTY FILE NAME ;V01-007 ; ;V01-007 PUSHAL DESCRIPTER ;V01-007 PUSHAL COUNT_L_SEQUENCE(R11) ;V01-007 CALLS #2,FILE_NAME ;V01-007 MOVW DESCRIPTER,LIST_RAB+RAB$W_RSZ ;V01-007 MOVAL LIST_BUFFER,LIST_RAB+RAB$L_RBF $PUT RAB=LIST_RAB ADDL2 #COUNT_SIZE,R11 DECL R10 BLEQ END_OUTPUT_LOOP BRW OUTPUT_LOOP END_OUTPUT_LOOP: .PAGE ;V01-004 .SUBTITLE OUTPUT STATISTICS ;V01-004 ; ;V01-004 ; OUTPUT THE HEADER ;V01-004 ; ;V01-004 MOVL STATISTICS_HEADER_0+4,STAT_RAB+RAB$L_RBF ;V01-010 MOVZBW STATISTICS_HEADER_0,STAT_RAB+RAB$W_RSZ ;V01-010 $PUT RAB=STAT_RAB ;V01-010 MOVAL LIST_BUFFER,STAT_RAB+RAB$L_RBF ;V01-010 MOVW #1,STAT_RAB+RAB$W_RSZ ;V01-010 MOVB #^A/ /,LIST_BUFFER ;V01-011 $PUT RAB=STAT_RAB ;V01-010 MOVL STATISTICS_HEADER_1+4,STAT_RAB+RAB$L_RBF ;V01-004 MOVZBW STATISTICS_HEADER_1,STAT_RAB+RAB$W_RSZ ;V01-004 $PUT RAB=STAT_RAB ;V01-004 MOVL STATISTICS_HEADER_2+4,STAT_RAB+RAB$L_RBF ;V01-004 MOVZBW STATISTICS_HEADER_2,STAT_RAB+RAB$W_RSZ ;V01-004 $PUT RAB=STAT_RAB ;V01-004 ; ;V01-004 ; CREATE THE POINTER COLUMN HEADER ;V01-004 ; ;V01-004 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-004 MOVC5 #0,STAT_BUFFER,#^A/ /,#13,STAT_BUFFER ;V01-004 MOVW #9,STAT_RAB+RAB$W_RSZ ;V01-004 MOVAL STAT_BUFFER+9,R11 ;V01-004 MOVAL POINTER_COUNT_LIST,R10 ;V01-004 MOVL #POINTER_SIZE_COUNT,R9 ;V01-004 1$: PUSHL (R10) ;V01-004 MOVAL (R11),DESCRIPTER+4 ;V01-004 MOVL #9,DESCRIPTER ;V01-004 PUSHAL DESCRIPTER ;V01-004 PUSHAL LENGTH ;V01-004 PUSHAL STAT_1_FORMAT ;V01-004 CALLS #4,G^SYS$FAO ;V01-004 ADDW2 #9,STAT_RAB+RAB$W_RSZ ;V01-004 ADDL2 #9,R11 ;V01-004 ADDL2 #4,R10 ;V01-004 SOBGTR R9,1$ ;V01-004 $PUT RAB=STAT_RAB ;V01-004 ; ;V01-004 ; NOW TO GENERATE THE LINES OF STATS ;V01-004 ; ;V01-004 MOVAL STATISTICS,R11 ;V01-004 MOVAL FILE_SIZE_LIST,R9 ;V01-004 MOVL #FILE_SIZE_COUNT,R10 ;V01-004 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-004 2$: MOVW #9,STAT_RAB+RAB$W_RSZ ;V01-004 PUSHL (R9) ;V01-004 MOVL #9,DESCRIPTER ;V01-004 MOVAL STAT_BUFFER,DESCRIPTER+4 ;V01-004 PUSHAL DESCRIPTER ;V01-004 PUSHAL LENGTH ;V01-004 PUSHAL STAT_1_FORMAT ;V01-004 CALLS #4,G^SYS$FAO ;V01-004 MOVL #POINTER_SIZE_COUNT,R8 ;V01-004 MOVAL STAT_BUFFER+9,R7 ;V01-004 3$: PUSHL (R11) ;V01-004 MOVAL (R7),DESCRIPTER+4 ;V01-004 PUSHAL DESCRIPTER ;V01-004 PUSHAL LENGTH ;V01-004 PUSHAL STAT_2_FORMAT ;V01-004 CALLS #4,G^SYS$FAO ;V01-004 ADDL2 #4,R11 ;V01-004 ADDL2 #9,R7 ;V01-004 ADDW2 #9,STAT_RAB+RAB$W_RSZ ;V01-004 SOBGTR R8,3$ ;V01-004 $PUT RAB=STAT_RAB ;V01-004 ADDL2 #4,R9 ;V01-004 DECL R10 ;V01-004 BLEQ 4$ ;V01-004 BRW 2$ ;V01-004 4$: ;V01-004 MOVW #1,STAT_RAB+RAB$W_RSZ ;V01-017 MOVAL LIST_BUFFER,STAT_RAB+RAB$L_RBF ;V01-017 MOVB #^A/ /,LIST_BUFFER ;V01-017 $PUT RAB=STAT_RAB ;V01-017 MOVL DIRECTORY_HEADER_0+4,STAT_RAB+RAB$L_RBF ;V01-017 MOVZBW DIRECTORY_HEADER_0,STAT_RAB+RAB$W_RSZ ;V01-017 $PUT RAB=STAT_RAB ;V01-017 MOVL DIRECTORY_HEADER_1+4,STAT_RAB+RAB$L_RBF ;V01-017 MOVZBW DIRECTORY_HEADER_1,STAT_RAB+RAB$W_RSZ ;V01-017 $PUT RAB=STAT_RAB ;V01-017 MOVAL DIRECTORY_MAP,R11 ;V01-017 CLRL R10 ;V01-017 5$: ;V01-017 MOVAL STAT_BUFFER,DESCRIPTER+4 ;V01-017 MOVL #60,DESCRIPTER ;V01-017 PUSHL (R11)+ ;V01-017 PUSHL R10 ;V01-017 ADDL2 #5,R10 ;V01-017 PUSHAL DESCRIPTER ;V01-017 PUSHAL LENGTH ;V01-017 PUSHAL DIRECTORY_FORMAT ;V01-017 CALLS #4,G^SYS$FAO ;V01-017 MOVAL STAT_BUFFER,STAT_RAB+RAB$L_RBF ;V01-017 MOVL LENGTH,STAT_RAB+RAB$W_RSZ ;V01-017 $PUT RAB=STAT_RAB ;V01-017 CMPL #100,R10 ;V01-017 BGTRU 5$ ;V01-017 .PAGE .SUBTITLE DONE-CLOSE FILES,FINAL MESSAGE AND EXIT $DISCONNECT RAB=INDEX_RAB $CLOSE FAB=INDEX_FAB $DISCONNECT RAB=LIST_RAB $CLOSE FAB=LIST_FAB $DISCONNECT RAB=STAT_RAB ;V01-004 $CLOSE FAB=STAT_FAB ;V01-004 PUSHAL FINAL_MESSAGE_1 ;V01-004 CALLS #1,G^LIB$PUT_OUTPUT PUSHAL FINAL_MESSAGE_2 ;V01-004 CALLS #1,G^LIB$PUT_OUTPUT ;V01-004 $EXIT_S .PAGE .SUBTITLE SYSTEM ERROR MESSAGE HANDLEING .ENTRY SYSTEM_ERROR_MESSAGE,^M ; ; CALLED WITH 3 ARGUMENTS ACCORING TO FORTRAN STD ; ARG1 INDEX ERROR MESSAGE PASS BY DESCRIPTER ; ARG2 SYSTEM ERROR VALUE (SS$_XXX OR RMS$_XXX) ; ARG3 SUPLIMENTAL VALUE TO ABOVE-USEUALLY FAB/RAB$L_STV VALUE ; OUTPUTS TO LIST FILE ARE NOT DONE HERE ; TSTL 4(AP) ;CHECK FOR CALLER SUPPLIED ERROR MESSAGE BEQL 16$ ;SKIP IF NONE PUSHAL @4(AP) ;FIRST OUTPUT THE INDEX ERROR MESSAGE CALLS #1,G^LIB$PUT_OUTPUT 16$: EXTZV #16,#12,@8(AP),R0 ;GET FACILITY CODE CMPL #0,R0 ;IS IT A SYSTEM CODE BNEQ 1$ ;NO BRW 100$ ;YES 1$: CMPL #1,R0 ;IS IT AN RMS CODE BEQL 2$ ;YES BRW 200$ ;NO .MACRO CHKERR ERR,DST,?A CMPL #ERR,R0 BNEQ A BRW DST A: .ENDM CHKERR 2$:; SET UP RMS ERROR CODES MOVW #2,MESSAGE_VECTOR MOVW #15,MESSAGE_VECTOR+2 MOVL @8(AP),MESSAGE_VECTOR+4 CLRL MESSAGE_VECTOR+8 MOVL @8(AP),R0 ; ; CHECK ERROR CODES THAT MIGHT HAVE A SECONDARY ERROR MESSAGE ; CHKERR RMS$_ACC,10$ CHKERR RMS$_AID,10$ CHKERR RMS$_ALN,10$ CHKERR RMS$_AOP,10$ CHKERR RMS$_ATR,10$ CHKERR RMS$_ATW,10$ CHKERR RMS$_BKZ,10$ CHKERR RMS$_CCF,10$ CHKERR RMS$_CDA,10$ CHKERR RMS$_CHN,10$ CHKERR RMS$_COD,10$ CHKERR RMS$_CRE,10$ CHKERR RMS$_CRMP,10$ CHKERR RMS$_DAC,10$ CHKERR RMS$_DAN,10$ CHKERR RMS$_DFL,10$ CHKERR RMS$_DNF,10$ CHKERR RMS$_DPE,10$ CHKERR RMS$_DTP,10$ CHKERR RMS$_ENQ,10$ CHKERR RMS$_ENT,10$ CHKERR RMS$_EXT,10$ CHKERR RMS$_FLG,10$ CHKERR RMS$_FND,10$ CHKERR RMS$_IAN,10$ CHKERR RMS$_IBF,10$ CHKERR RMS$_IBK,10$ CHKERR RMS$_IFA,10$ CHKERR RMS$_IFL,10$ CHKERR RMS$_IMX,10$ CHKERR RMS$_IRC,10$ CHKERR RMS$_KNM,10$ CHKERR RMS$_KSI,10$ CHKERR RMS$_LAN,10$ CHKERR RMS$_MKD,10$ CHKERR RMS$_NET,10$ CHKERR RMS$_NETFAIL,10$ CHKERR RMS$_ORD,10$ CHKERR RMS$_POS,10$ CHKERR RMS$_RER,10$ CHKERR RMS$_RMV,10$ CHKERR RMS$_RPL,10$ CHKERR RMS$_SIZ,10$ CHKERR RMS$_SPL,10$ CHKERR RMS$_SUP,10$ CHKERR RMS$_SYS,10$ CHKERR RMS$_SUPPORT,10$ CHKERR RMS$_WBE,10$ CHKERR RMS$_WER,10$ CHKERR RMS$_WPL,10$ CHKERR RMS$_XAB,10$ BRW 300$ 10$: MOVL @12(AP),MESSAGE_VECTOR+8 ;PRIMARY ERROR HAS SECONDARY BRW 300$ ;ERROR MESSAGE 100$: ; ;SYSTEM ERROR CODES ; MOVW #1,MESSAGE_VECTOR MOVW #15,MESSAGE_VECTOR+2 MOVL @8(AP),MESSAGE_VECTOR+4 ; ; ADD SYSTEM ERROR CHECKS HERE FOR FA0 ARGS ; BRW 300$ 200$: ; ; ALL OTHER ERROR TYPES ; MOVW #2,MESSAGE_VECTOR MOVW #15,MESSAGE_VECTOR+2 MOVL @8(AP),MESSAGE_VECTOR+4 CLRL MESSAGE_VECTOR+8 BRW 300$ 300$: PUSHAL MESSAGE_VECTOR CALLS #1,G^SYS$PUTMSG RET .PAGE ;V01-007 .SUBTITLE GENERATE FILE NAME ;V01-007 .ENTRY FILE_NAME,^M ;V01-007 ; ;V01-007 ; TWO ARGUMENTS PASSED BY REFERENCE ;V01-007 ; FILE HEADER NUMBER ;V01-007 ; DESCRIPER OF LINE TO PUT DATA INTO. LINE ALREADY FILLED ;V01-007 ; AND ADDITIONAL STRING PUT ON END ;V01-007 ; ;V01-007 MOVL 8(AP),R11 ;GET ADDR OF DESCRIPTER ;V01-007 MOVZBL (R11),R10 ;GET LENGTH ;V01-007 MOVL 4(R11),R9 ;GET STARTING ADDR ;V01-007 ADDL3 R10,R9,R8 ;GET NEXT STARTING LOC ;V01-007 ; ; FILL IN EMPTY DIRECTORY DELIMITERS ; MOVW #^A/[]/,(R8) ;V01-007 ADDL2 #2,R10 ;V01-007 ; ; GET THE FILE HEADER ; ADDL3 @4(AP),FILE_HEADER_1_VBN,R0 ;V01-007 SUBL3 #1,R0,INDEX_RAB+RAB$L_BKT ;V01-007 MOVAL INDEX_BLOCK_2,INDEX_RAB+RAB$L_UBF ;V01-007 MOVW #512,INDEX_RAB+RAB$W_USZ ;V01-011 $READ RAB=INDEX_RAB ;V01-007 BLBS R0,2$ $EXIT_S R0 ; ; GET THE FILE NAME ; 2$: MOVZBL FH2$B_IDOFFSET+INDEX_BLOCK_2,R7 ;V01-007 MULL2 #2,R7 ;V01-007 ; ;V01-012 ; BUILD A CONTIGUOUS FORM OF THE FILE NAME ;V01-012 ; ;V01-012 MOVC3 #FI2$S_FILENAME,- ;V01-012 INDEX_BLOCK_2+FI2$T_FILENAME(R7),- ;V01-012 TEMP_NAME ;V01-012 .IF DF FI2$S_FILENAMEXT ;V01-014 MOVC3 #FI2$S_FILENAMEXT,- ;V01-012 INDEX_BLOCK_2+FI2$T_FILENAMEXT(R7),- ;V01-012 TEMP_NAME+FI2$S_FILENAME ;V01-012 .ENDC ;V01-014 ; ; LOCATE TERMINATEING BLANK OF FILE NAME ; .IF DF FI2$S_FILENAMEXT ;V01-014 LOCC #^A/ /,#,- ;V01-012 TEMP_NAME ;V01-012 SUBL3 R0,#,R1 ;V01-012 .IFF ;V01-014 LOCC #^A/ /,#,TEMP_NAME ;V01-014 SUBL3 R0,#,R1 ;V01-014 .ENDC ;V01-014 ADDL2 R1,R10 ;BUMP COUNT OF LINE SIZE ;V01-007 MOVC3 R1,TEMP_NAME,2(R8) ;V01-012 INCL R8 ;V01-007 ; ; NOW DO A LOOP BACK THROUGH BACK POINTERS THROUGH DIRECTORIES ; BUILDING THE EXACT LOCATION IN DIR TREE OF FILE ; DIR_LOOP: ; ; GET SEQUENCE NUMBER OF DIRECTORY VIA BACK POINTER ; MOVW INDEX_BLOCK_2+FH2$W_BK_FIDNUM,TEMP_SEQUENCE ;V01-007 MOVZBW INDEX_BLOCK_2+FH2$B_BK_FIDNMX,TEMP_SEQUENCE+2 ;V01-007 TSTL TEMP_SEQUENCE ;V01-008 BNEQ 5$ ;V01-008 BRW END_DIR_LOOP ;V01-008 5$: ;V01-008 ; ; AND READ IN THE FILE HEADER ; ADDL3 FILE_HEADER_1_VBN,TEMP_SEQUENCE,R0 ;V01-007 SUBL3 #1,R0,INDEX_RAB+RAB$L_BKT ;V01-007 MOVAL INDEX_BLOCK_2,INDEX_RAB+RAB$L_UBF ;V01-007 MOVW #512,INDEX_RAB+RAB$W_USZ ;V01-011 $READ RAB=INDEX_RAB ;V01-007 BLBS R0,2$ $EXIT_S R0 ; ; GET THE DIR NAME ; 2$: MOVZBL FH2$B_IDOFFSET+INDEX_BLOCK_2,R5 ;V01-007 MULL2 #2,R5 ;V01-007 ; ;V01-012 ; BUILD A CONTIGUOUS FORM OF THE DIRECTORY NAME ;V01-012 ; ;V01-012 MOVC3 #FI2$S_FILENAME,- ;V01-012 INDEX_BLOCK_2+FI2$T_FILENAME(R5),- ;V01-012 TEMP_NAME ;V01-012 .IF DF FI2$S_FILENAMEXT ;V01-014 MOVC3 #FI2$S_FILENAMEXT,- ;V01-012 INDEX_BLOCK_2+FI2$T_FILENAMEXT(R5),- ;V01-012 TEMP_NAME+FI2$S_FILENAME ;V01-012 .ENDC ;V01-014 ; ; LOCATE DOT IN DIR NAME ; .IF DF FI2$S_FILENAMEXT ;V01-014 LOCC #^A/./,#,- ;V01-012 TEMP_NAME ;V01-012 SUBL3 R0,#,R7 ;V01-012 .IFF ;V01-014 LOCC #^A/./,#,TEMP_NAME ;V01-014 SUBL3 R0,#,R7 ;V01-014 .ENDC PUSHR #^M ;V01-007 ; ; SEE IF DOT IS NEEDED IN DIR STRING ; CMPB #^A/]/,(R8) ;IS THIS FIRST DIR ENTRY ;V01-007 BEQL 1$ ; ;V01-002 ; SEE IF THIS IS DIR [000000] IF SO AT THIS POINT ;V01-002 ; OTHER DIR ENTRIES HAVE BEEN MADE SO THIS IS NOT ;V01-002 ; NEEDED-SKIP PUTTING IT IN ;V01-002 ; ;V01-002 TSTB INDEX_BLOCK_2+FH2$B_FID_NMX ;V01-007 BNEQ 4$ ;V01-002 CMPW #4,INDEX_BLOCK_2+FH2$W_FID_NUM ;V01-007 BNEQ 4$ ;V01-002 BRW END_DIR_LOOP ;V01-002 4$: INCL R7 ;DOT NEEDED ;V01-002 1$: ADDL2 R7,R10 ;BUMP COUNT OF LINE SIZE ;V01-007 ; ; MOVE NAME AS BUILT SO FAR DOWN TO FIT IN DIR NAME ; SUBL3 R10,#4096,R6 ;V01-007 SUBL2 R7,R6 ;V01-007 ADDL3 R7,R8,R1 ;V01-007 MOVC3 R6,(R8),(R1) ;V01-007 ; ; MOVE IN DIR NAME ; POPR #^M ;V01-007 MOVC3 R7,TEMP_NAME,(R8) ;V01-012 ; ; NOW SEE IF THIS IS DIR [000000] WE JUST GOT-IF SO DONE ; TSTB INDEX_BLOCK_2+FH2$B_FID_NMX ;V01-007 BNEQ 3$ CMPW #4,INDEX_BLOCK_2+FH2$W_FID_NUM ;V01-007 BNEQ 3$ BRW END_DIR_LOOP 3$: BRW DIR_LOOP END_DIR_LOOP: MOVZBL R10,(R11) ;V01-007 RET ;V01-007 .PAGE ;V01-011 .SUBTITLE READ AND TRANSFER FILE HEADER BLOCKS ;V01-011 .ENTRY READ_HEADER,^M ;V01-011 ; ;V01-011 ; PASS 2 ARGUMENTS BY REFERENCE ;V01-011 ; FID FILE ID OF FILE HEADER TO BE TRANSFERED ;V01-011 ; BUFFER LOCATION OF BUFFER TO RECIEVE HEADER ;V01-011 ; ;V01-011 ; SEE IF WANTED HEADER IS IN BUFFER ;V01-011 ; ;V01-011 CMPL HEADER_BUFFER_FIRST_FID,@4(AP) ;V01-011 BGTRU 1$ ;V01-011 SUBL3 HEADER_BUFFER_FIRST_FID,@4(AP),R11 ;V01-011 CMPL R11,HEADER_BUFFER_HEADER_COUNT ;V01-011 BGEQU 1$ ;HIGHER THAN LAST IN BUFFER ;V01-011 MULL2 #512,R11;GET OFFSET INTO BUFFER ;V01-011 MOVC3 #512,HEADER_BUFFER(R11),@8(AP) ;V01-011 MOVL #1,R0 ;V01-011 RET ;V01-011 ; ;V01-011 ; HEADER NOT IN BUFFER-UPDATE BUFFER ;V01-011 ; ;V01-011 1$: MOVC5 #0,HEADER_BUFFER,#0,#,-;V01-011 HEADER_BUFFER ;V01-011 ADDL3 @4(AP),FILE_HEADER_1_VBN,R0 ;V01-011 SUBL3 #1,R0,INDEX_RAB+RAB$L_BKT ;V01-011 MOVAL HEADER_BUFFER,INDEX_RAB+RAB$L_UBF ;V01-011 MOVW #,INDEX_RAB+RAB$W_USZ ;V01-011 $READ RAB=INDEX_RAB ;READ BLOCK OF HEADERS ;V01-011 BLBS R0,4$ ;BRANCH IF NO ERROR ;V01-011 CMPL #RMS$_EOF,R0 ;WAS ERROR E.O.F. ;V01-011 BNEQ 5$ ;NO ;V01-011 BRW 10$ ;HANDLE EOF CONDITION ;V01-011 ; ;V01-011 ; ERROR FOUND NOT EOF-REPORT IT AND EXIT ;V01-011 ; ;V01-011 5$: PUSHAL INDEX_RAB+RAB$L_STV ;V01-011 PUSHAL INDEX_RAB+RAB$L_STS ;V01-011 PUSHAL INDEX_READ_ERROR ;V01-011 CALLS #3,SYSTEM_ERROR_MESSAGE ;V01-011 $EXIT_S ;V01-011 ; ;V01-011 ; TRANSFER FIRST HEADER TO USER BUFFER ;V01-011 ; ;V01-011 4$: MOVL @4(AP),HEADER_BUFFER_FIRST_FID ;V01-011 MOVL #HEADER_BUFFER_COUNT,HEADER_BUFFER_HEADER_COUNT ;V01-011 MOVC3 #512,HEADER_BUFFER,@8(AP) ;V01-011 MOVL #1,R0 ;V01-011 RET ;V01-011 ; ;V01-011 ; HANDLE EOF-SEE IF NO OR PARTIAL XFER ;V01-011 ; ;V01-011 10$: MOVZWL INDEX_RAB+RAB$W_RSZ,R1 ;V01-011 BNEQ 11$ ;V01-011 RET ;NOTHING XFERD-PASS BACK EOF ;V01-011 11$: DIVL3 #512,R1,HEADER_BUFFER_HEADER_COUNT ;V01-011 MOVL @4(AP),HEADER_BUFFER_FIRST_FID ;V01-011 MOVC3 #512,HEADER_BUFFER,@8(AP) ;V01-011 MOVL #1,R0 ;V01-011 RET ;V01-011 .END FILE_CHECK