d;************************************************************; ; given a volume and logical block number (lbn) ,; print file owner uic and filename.ext.version .; by susan kidd feb 10,1982 ;************************************************************;  .PSECT code_data,wrt,rd,noexe X .LIBRARY /SYS$LIBRARY:LIB.MLB/  $fh2def  $fhidef  $hm2def  $dscdef  L .MACRO LIB$GET_INPUT INPUT_DESC,PROMPT  PUSHAL PROMPT x PUSHAL INPUT_DESC  CALLS #2,G^LIB$GET_INPUT @.ENDM LIB$GET_INPUT  lSECFAB: $FAB dns=namsiz,dna=filename,fop=ufo  4FILENAME: VOL: .ASCII / / ;10 spaces reserved for volume name BLANKS: .ASCII / / ;and blanks to clear field ` .ascii/[0,0]indexf.sys/ NAMSIZ=.-FILENAME ( FF: .ASCII/ FILENAME= / FNAME: .BLKB 20 T FSIZE=.-FF FNAM_D: .LONG FSIZE,FF  FAODESC: .LONG 80 H .LONG FAOBUF FAOBUF: .BLKB 80 FAOLEN: .BLKW 1 t UICSTR: .ASCID / FILE OWNER UIC= [!OW,!OW]/ <LINE: .ASCID @!/@  NOPE_D: .ASCID / LBN NOT LOCATED/ hOPEN_D: .ASCID / OPEN ERROR : NON-EXISTENT VOLUME ? / MAP_D: .ASCID / ERROR MAPPING SECTION / 0FAT_D: .ASCID / PROGRAMMING ERROR--ADD HAD CARRY/  VOL_PR: .ASCID / ENTER VOLUME NAME (max=9 chars) FOLLOWED BY A COLON: / \LBN_PR: .ASCID @ ENTER LBN (fmt=(D)/X/O eg. X3F6D0): @ RESP: .LONG 0,0 $BEGMAP: .LONG ENDMAP: .LONG HEADER: .LONG PBITNUM: .LONG MEMBER: .WORD GROUP: .WORD |BOTH: ;longword for concatenating bits LOW: .WORD DHIGH: .WORD GETLBN: .LONG ;lbn we are looking for  ;open index file indexf.sys for vol,readonly,recl=512 pMAPRANGE:  .LONG ^X200 ;any program (p0)region address 8 .long ^x200 RETRANGE:  .BLKL 2 ;address range returned here d.PAGE  .PSECT code_code,nowrt,rd,exe ,.ENTRY CODE,^M  GET_VOL: X $FAO_S CTRSTR=LINE,OUTBUF=FAODESC,OUTLEN=FAOLEN ;2 blank lines  MOVZWL FAOLEN,FAODESC  PUSHAL FAODESC  CALLS #1,G^LIB$PUT_OUTPUT  CLRQ RESP ;prompt and read volume L MOVB #DSC$K_CLASS_D,RESP+DSC$B_CLASS  LIB$GET_INPUT RESP,VOL_PR  TSTW RESP x BNEQ 10$  $EXIT_S @10$:  CMPW RESP,#10 ;max is 10 characters  BGTRU GET_VOL l MOVC3 #10,BLANKS,VOL ;fill in for open MOVC3 RESP,@RESP+4,VOL 4! $OPEN FAB=SECFAB ! CMPW #SS$_NORMAL,R0 ! BEQL 1$ `" JMP OPEN_ERROR "1$: (#GET_LBN: # CLRQ RESP ;prompt and read lbn # MOVB #DSC$K_CLASS_D,RESP+DSC$B_CLASS T$ LIB$GET_INPUT RESP,LBN_PR $ DECW RESP ;assume X or D or O typed % BLSS GET_LBN ;whoops,typed nothing % MOVL 4+RESP,R0 % INCL RESP+4 H& MOVZBL (R0),R0 ;look at first char ' CMPB #^A/D/,R0 t' BEQL 31$ ' CMPB #^A/d/,R0 <( BEQL 31$ ( CMPB #^A/X/,R0 ) BEQL 32$ h) CMPB #^A/x/,R0 ) BEQL 32$ 0* CMPB #^A/O/,R0 * BEQL 33$ * CMPB #^A/o/,R0 \+ BEQL 33$ + DECL RESP+4 ;restore pointer,assume D $, INCW RESP ,31$: PUSHAL GETLBN ;D , PUSHAL RESP P- CALLS #2,G^OTS$CVT_TI_L - JMP MAP_SECTION .32$: PUSHAL GETLBN ;X |. PUSHAL RESP . CALLS #2,G^OTS$CVT_TZ_L D/ JMP MAP_SECTION /33$: PUSHAL GETLBN ;O 0 PUSHAL RESP p0 CALLS #2,G^OTS$CVT_TO_L 0 81MAP_SECTION: 1 CMPL #SS$_NORMAL,R0 ;test results of conversion 2 BEQL 10$ d2 JMP GET_LBN 210$: ,3 $CRMPSC_S inadr=MAPRANGE,- 3 retadr=RETRANGE,- ;output array 3 flags=#SEC$M_EXPREG,- X4 vbn=#2,- ;start with home block 4 chan=SECFAB+FAB$L_STV 5 CMPL RETRANGE,#-1 5 BNEQ 2$ 5 JMP MAP_ERROR L62$: x7 MOVL RETRANGE,R6 ;home block addr 7 MOVZWL HM2$W_IBMAPVBN(R6),BEGMAP ;vbn of map area @8 DECL BEGMAP 8 DECL BEGMAP 9 MULL2 #512,BEGMAP l9 ADDL2 R6,BEGMAP ;map area addr 9 4: MOVZWL HM2$W_IBMAPSIZE(R6),ENDMAP ;mapsize in blocks : ASHL #9,ENDMAP,ENDMAP ;multiply by 512 : ADDL2 BEGMAP,ENDMAP ;point to end of map area `; ; ;get each file header marked in use in index bitmap (< MOVL ENDMAP,HEADER ;start with 1st header < CLRL BITNUM ;assoc with bit number 0 NEXTHD: INCL BITNUM ;next bit > ADDL2 #512,HEADER ;next header > CMPL HEADER,RETRANGE+4 ;end of headers? H? BLSSU LOOP ;...no ? JMP NOFOUND @ t@GOTONE: @ MOVL HEADER,R8 ;r8 is current header