HOL.MAC/-BF=HOL.VGN \ -2,,/;RAW001/ .ENABL LC -32,32,/;RAW001/ ; ; ;****************************************************************************** ; ; This software is provided on an "as is" basis only. Caterpillar Tractor Co., ; disclaims all warranties on the program, including without limitation, all ; implied warranties of merchantablity and fitness. ; ; Full permission and consent is hereby given to DECUS and to the DECUS ; special interest groups to reproduce, distribute, and publish and permit ; others to reproduce in whole or in part, in any form and without restriction ; this program and any information relating thereto ; ;****************************************************************************** ; ; 11/18/82 Rick Webster, MSDGO, Caterpillar Tractor Co. ; RAW001 Modifications include: ; 1) Eliminate syntax checking subroutines and ; use .TPARS instead ; 2) Display logical block numbers in decimal ; instead of octal by default ; 3) Add /Octal switch to optionally display ; logical block numbers in octal ; 4) Change messages to upper and lower case ; ; ; % -56,58,/;RAW001/ ; Switch definitions SW.OCT = 1 ; .MCALL GTIM$,QIOW$,CALL,EXIT$S,DIR$ .MCALL FCSMC$,ALUN$,GMCR$,GLUN$,FCSBT$ .MCALL ISTAT$,STATE$,TRAN$ -76,,/;RAW001/ ASCBLK: .ASCII /123456789/ ; Decimal block number from $CDDMG .EVEN -88,88,/;RAW001/ IDPB: QIOW$ IO.RVB,ERRDEV,1,,IOST,, ; -107,117,/;RAW001/ SWFLAG: 0 ; Switch flag word CMDLTH: 0 ; Length of MCR command line .NLIST BEX TOTBUF: .ASCII /Total Free Blocks: / TOTAMT: .ASCII / ./ TOTSIZ= .-TOTBUF ER1: .ASCII /HOL -- Bad switch/ ER1SIZ=.-ER1 ER2: .ASCII /HOL -- Failure on reading BITMAP.SYS/ ER2SIZ=.-ER2 ER3: .ASCII /HOL -- Command error/ ER3SIZ= .-ER3 ER4: .ASCII /HOL -- Illegal device/ -124,124,/;RAW001/ ISTRNG: .ASCII /Contiguous Free Blocks (Holes) For Device / -135,144,/;RAW001/ \ ; HOL [ddn:][/nnn][/Octal] ; ; WHERE: ; dd - A legal FILES-11 device name ; n - A legal unit number for the selected device ; If 'ddn:' is not specified 'SY0:' is assumed ; ; /nnn - Is an optional positive, nonzero integer of 9 ; decimal digits or less. If present, it defines ; the minimum size hole to be reported. ; ; /O - Specifies that logical block numbers are to be ; displayed in octal instead of decimal. Can be ; entered as /O, /OC, /OCT, /OCTA or /OCTAL ; ; % -148,193,/;RAW001/ DIR$ #GMCR ; GET COMMAND LINE BCC 10$ ; If CC OK - carry on CALL GETLIN ; Else prompt for line BR 15$ ; And process as normal ; 10$: MOV $DSW,CMDLTH ; Get length of command line 15$: CLR LOWLIM ; Assume low limit is zero CLR LOWLIM+2 ; " CLR SWFLAG ; Clear switch word CLR R1 ; Set TPARS for ignoring spaces & tabs MOV #KEYTBL,R2 ; Address of keyword table in R2 MOV CMDLTH,R3 ; Length of command line to parse MOV #GMCR+G.MCRB,R4 ; Address of command line to parse MOV #PARCMD,R5 ; Address of state table CALL .TPARS ; Parse command line BCC 16$ ; Branch if syntax is ok JMP ERROR3 ; Go indicate syntax error 16$: DIR$ #ALUN,ERROR4 ; Assign lun to device to check DIR$ #GLUN ; Now get lun info for that device BIT #FD.DIR,GLBUF+G.LUCW ; File structured device? BNE 17$ ; Yes - branch JMP ERROR4 ; No - indicate illegal device 17$: MOVB GLBUF+G.LUNA,ASCDEV ; Put device in display header MOVB GLBUF+G.LUNA+1,ASCDEV+1 ; " MOV #ASCDEV+2,R0 ; Destination address for $CBTA MOV GLBUF+G.LUNU,R1 ; Logical unit for $CBTA to convert BIC #177400,R1 ; Clear flags byte (high byte) MOV #20*400+10,R2 ; 2 octal digits, zero suppress CALL $CBTA ; Put unit number in display header MOVB #':,(R0) ; Append a colon to unit number ; -211,214,/;RAW001/ 25$: BIT #SW.OCT,SWFLAG ; Display LBN's in octal? BEQ 26$ ; No - branch MOV #BLKADR,R1 ; PACK DISK BLOCK ADDRESS (IN OCTAL) MOV #AFLDSZ,R2 ; RIGHT-JUSTIFIED, 'AFLDSZ' DIGITS CALL CDBOM BR 50$ 26$: MOV R0,-(SP) ; Save R0 MOV #ASCBLK,R0 ; Put destination address in R0 MOV #BLKADR,R1 ; Put LBN in R1 CLR R2 ; Zero suppression indicator CALL $CDDMG ; Convert LBN to decimal MOV #ASCBLK,R1 ; R1 has address of converted string SUB R1,R0 ; R0 has # of characters in converted string MOV R0,R2 ; Save number of characters in R2 MOV #AFLDSZ,R1 ; R1 has length of display field SUB R0,R1 ; R1 has number of spaces to stuff in field MOV (SP)+,R0 ; Restore R0 (display field address) 29$: MOVB #' ,(R0)+ ; Right justify LBN SOB R1,29$ MOV #ASCBLK,R1 ; R1 has address of LBN string 30$: MOVB (R1)+,(R0)+ ; Put LBN string in display field SOB R2,30$ 45$: MOVB #'.,(R0)+ ; Append a '.' to show it is decimal 50$: MOVB #':,(R0)+ ; SEPARATE FROM HOLE SIZE WITH ':' -220,221,/;RAW001/ BR 60$ 55$: JMP GTHOLE 60$: SOB R4,55$ ; LOOP 'TIL LINE IS FULL 110$: MOVB #CR,-1(R0) ; REPLACE LAST TAB WITH EOL -394,516,/;RAW001/ -696,696,/;RAW001/ MOV IOST+2,CMDLTH ; Get number of chars -703,707,/;RAW001/ MOV CMDLTH,R1 ; R1 has # of chars entered BEQ 40$ ; Branch if no chars entered MOV #GMCR+6,R0 ; Set input address 25$: BITB #100,(R0) ; A letter? -712,718,/;RAW001/ INC R0 ; Point to next character SOB R1,25$ ; loop until all chars converted to UC ; 40$: MOV #"HO,GMCR+2 ; Fake the first part MOV #"L ,GMCR+4 ; ADD #4,CMDLTH ; RETURN ; OK, GO HOME .PAGE .SBTTL State tables for .TPARS ISTAT$ STATE1,KEYTBL STATE$ PARCMD ;Parse command line TRAN$ $STRNG ;Bypass program name 'HOL' STATE$ TRAN$ !DEV,CHKSW ;See if a device was specified TRAN$ $LAMDA,CHKSW ;If not, just check for switches STATE$ CHKSW TRAN$ '/,GETSW ;Check for switch TRAN$ $EOS,$EXIT ;Only exit from TPARS STATE$ GETSW TRAN$ $DNUMB,CHKSW,SETSIZ ;Check for /nnn TRAN$ "O",CHKSW,,SW.OCT,SWFLAG ;Check for /O (octal) TRAN$ "OC",CHKSW,,SW.OCT,SWFLAG ;Check for /OC (octal) TRAN$ "OCT",CHKSW,,SW.OCT,SWFLAG ;Check for /OCT (octal) TRAN$ "OCTA",CHKSW,,SW.OCT,SWFLAG ;Check for /OCTA (octal) TRAN$ "OCTAL",CHKSW,,SW.OCT,SWFLAG ;Check for /OCTAL (octal) STATE$ DEV ;/dev subexpression TRAN$ $ALPHA,,MNEM1 ;Check for 1st letter of device name STATE$ TRAN$ $ALPHA,,MNEM2 ;Check for 2nd letter of device name STATE$ TRAN$ ':,$EXIT ;return if implied unit of 0 TRAN$ $NUMBR,CKCOL2,STUNIT ;Get unit number TRAN$ $LAMDA,$EXIT ;Return if implied unit 0 with no : STATE$ CKCOL2 TRAN$ ':,$EXIT ;Return if : entered TRAN$ $LAMDA,$EXIT ;Return if : not entered STATE$ ;End of state table ; ; TPARS Action routines ; MNEM1: MOVB .PCHAR,ALUN+A.LUNA ;1st char of device mnumonic RETURN MNEM2: MOVB .PCHAR,ALUN+A.LUNA+1 ;2nd char of device mnumonic CLR ALUN+A.LUNU ;Assume unit 0 RETURN STUNIT: MOV .PNUMB,ALUN+A.LUNU ;Device unit RETURN SETSIZ: MOV .PNUMH,LOWLIM ;Store high order of low limit MOV .PNUMB,LOWLIM+2 ;Store low order of low limit RETURN /