.MCALL .MODULE .MODULE DIR,VERSION=09,COMMENT=,AUDIT=YES ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .AUDIT .DIRPRE,.DIR1ST,.DIRMN,.DIRT11,.DIRSWT,.DIRMAT,.DIRDK,.DIRMT .AUDIT .DIRCT,.DIRSUP,.DIRSRT,.DIROUT,.DIRERR .NLIST ;- ; ; DIR (Directory Program) ; .LIST ;+ ; ; Module DIRDAT ; This module defines all global data in DIR. It must be the first ; code module in the link (DIR1ST produces no code). ; ; Edit History: ; ; V05 (007) 27-Jun-89 Data area for LTRANP routine in DIRT11 ; MBG ; ; V05 (008) 10-Oct-96 New version number for handling 4-digit ; Tim Shoppa in output, options, and magtape operation. ; ; V05 (009) 7-Oct-1998 Now a UFLAG to mark whether we have two "days" ;- .SBTTL Offsets and Symbolics ; System Communication area S$STRT == 40 ;Job start address S$INSP == 42 ;Job initial stack pointer S$JSW == 44 ;Job status word JS.REE == 20000 ; 1 => Program is reenterable S$USRL == 46 ;Floating USR load address S$HILM == 50 ;Job's hi address S$EERR == 52 ;EMT error return byte S$UERR == 53 ;User error return byte ERR$$I == 0 ; Information message ;MG01+ ERR$$W == 1 ; Warning message ERR$$E == 2 ; Error message ERR$$F == 3 ; Fatal/severe message ERR$$U == 4 ; Unconditional abort ;MG01- S$RMON == 54 ;Pointer to base of Resident Monitor ; Fixed offsets F$USR == 266 ;Pointer to base of USR S$VER == 276 ;Offset from RMON to monitor version number .SBTTL Directory offsets and symbolics ; Disk directory header offsets DH.AVL == 0 ;Number of available directory segments DH.NXT == 2 ;Pointer to next directory segment DH.HI == 4 ;Highest directory segment open DH.EXB == 6 ;Number of extra bytes in directory entries DH.STB == 10 ;Starting block number for files in segment DH.SIZ == 12 ;Size of directory header words ; Disk directory entry offsets and symbolics DE.ST == 0 ;Entry status DS.TNT == 400 ; 1 => tentative entry DS.EMP == 1000 ; 1 => empty entry DS.PRM == 2000 ; 1 => permanent entry DS.EOS == 4000 ; 1 => end-of-segment entry DS.PRO == 100000 ; 1 => protected file DE.FN1 == 2 ;Offset to first word of filename DE.FN2 == 4 ;Offset to second word of filename DE.TYP == 6 ;Offset to filetype DE.LEN == 10 ;Offset to filesize DE.STR == 12 ;Offset to starting block ;008 ; (Not in a real directory entry, ;008 ; but used as such by sort.) ;008 DE.DAT == 14 ;Offset to file creation date DE.SIZ == 16 ;Size of directory entry ; Magtape directory offsets and symbolics MT.VOL == "VO ;VOL label identification MT.VID == 4 ;Offset to magtape volume id MT.VLN == 6 ;Length of magtape volume id MT.OWN == 37. ;Offset to magtape owner name MT.VP1 == 'D ;First part of owner validation pattern MT.VP2 == "%B ;Second part. MT.OLN == 12 ;Length of magtape owner name MT.HDR == "HD ;HDR label identification MT.HFI == 4 ;Offset to file identifier MT.HDT == 41. ;Offset to file creation date MT.EOF == "EO ;EOF label identification LABSIZ == 400 ;Size of RT-11 labels in words ; Disk homeblock offsets HOMBLK == 1 ;Disk home block DK.VID == 730 ;Offset to volume id DK.VLN == 14 ;Length of volume id DK.OWN == 744 ;Offset to owner name DK.OLN == 14 ;Length of owner name DK.VAL == 726 ;Offset to volume validation pattern ; Other offsets and symbolics ICHAN == 0 ;Input channel number OCHAN == 1 ;Output channel number HICHAN == 1 ;Highest channel number used INBFSZ == 2000 ;Size of input buffer in bytes OUBFSZ == 1000 ;Size of output buffer in bytes OUSPSZ == 12 ;Size of CSI output file spec in bytes INSPSZ == 10 ;Size of CSI input file spec in bytes INSPST == ;Offset to start of CSI input specs SPCSIZ == +;Size of CSI filespecs in bytes R50STR == 132500 ;RAD50 '*' R50V3A == ^RV3A ;RAD50 'V3A' R50TT == ^RTT ;RAD50 'TT' R50DK == ^RDK ;RAD50 'DK' CR == 15 ;ASCII LF == 12 ;ASCII BLANK == 40 ;ASCII ' ' PRCENT == 45 ;ASCII '%' ASTERK == 52 ;ASCII '*' DOT == 56 ;ASCII '.' D == 125 ;ASCII 'U' O == 117 ;ASCII 'O' SEQDEV == 100000 ;.DSTATUS status word. 0 => sequential device NRTDIR == 10000 ;.DSTATUS status word. 1 => non RT-11 ; directory structured device (MT) CTIDEN == 13 ;.DSTATUS CT identification number LPIDEN == 3 ;.DSTATUS LP identification number MMIDEN == 11 ;.DSTATUS MM identification number MTIDEN == 20 ;.DSTATUS MT identification number MSIDEN == 35 ;.DSTATUS MS identification number ;AC01 MUIDEN == 60 ;.DSTATUS MU identification number TTIDEN == 4 ;.DSTATUS TT identification number SP.RW == -5 ;.SPFUN rewind code (MT) SP.RED == -10 ;.SPFUN read code (MT) SP.SF == -2 ;.SPFUN space forward code (MT) SP.BB == -2 ;.SPFUN back space block (CT) SP.FF == -3 ;.SPFUN forward file (CT) .SBTTL PSECT DEFINITIONS .PSECT PURE,D ;Pure data psect .PSECT $$$FMT ;FORMAT picture strings ;CG09 .PSECT .LIBD. ;Library routine data ;CG09 .PSECT .LIBP. ;Library routine pointers ;CG09 .PSECT IMPURE,D ;Impure data psect .PSECT CLEAR,D ;Contains list of data items to cleared on CLRLST:: ; program start up and restart .PSECT SWTCHR,D ;Contains list of valid switches SWLIST:: ; .PSECT ACTION,D ;Contains addresses of routines to execute ACTLST:: ; when a particular switch is encountered .PSECT ERRLST,D ;Contains addresses of error messages .PSECT DIR ;Main program .PSECT RT11 ;RT-11 dependent stuff .PSECT SWITCH ;Switch processing routines .PSECT MATCH ;Filename match routines .PSECT DISK ;Disk directory handler .PSECT MT ;Magtape directory handler .PSECT CT ;Cassette directory handler .PSECT SORT ;Sorting routines .PSECT OUTPUT ;Output routines .PSECT SUPORT ;General support routines .PSECT .LIBC. ;Library code ;CG09 .PSECT PATCH ;Patch psect .BLKW 64. ;64 words of patch space .SBTTL Switch declarations ;+ ; ; Macro SWITCH ; This macro defines all valid switches to DIR. It assumes 1 that the switch ; will be 1 RAD50 character. The arguments are: ; CHR - 1 RAD50 character to be used as the CSI switch ; ROUTINE - the name of the routine to be executed when this switch is ; encountered. ; The last switch declartion MUST be of the form: ; SWITCH ,0 ; The switch declarations MUST appear after the psect definition of CLEAR ; and BEFORE the list of items to be cleared on program start up and restart. ; ;- .MACRO SWITCH CHR,ROUTINE .PSECT SWTCHR,D .IF NB CHR .BYTE ''CHR .IFF .BYTE 0 .IFTF .PSECT ACTION,D .IFT .GLOBL ROUTINE .WORD ROUTINE SW'CHR::.WORD 0 .IFF .WORD 0 .IFT .PSECT CLEAR,D .WORD SW'CHR .ENDC .ENDM SWITCH ACTSIZ == 4 SWITCH A NOVAL ;Alphabetic sort SWITCH B NOVAL ;List starting block number SWITCH C SC ;Number of listing columns SWITCH D SD ;Date SWITCH E NOVAL ;Full directory SWITCH F NOVAL ;Fast directory SWITCH G SG ;'Start at' SWITCH J SWJK ;'Since' SWITCH K SWJK ;'Before' SWITCH L NOVAL ;List directory (with /N) SWITCH M NOVAL ;Empties only SWITCH N NOVAL ;Summary SWITCH O NOVAL ;Octal file size and start block SWITCH P NOVAL ;Exclude SWITCH Q NOVAL ;Deleted files SWITCH R NOVAL ;Reverse sort SWITCH T NOVAL ;Protected files SWITCH U NOVAL ;Unprotected files SWITCH S SS ;Sort SWITCH V SV ;Volid and owner name ;CG07 SWITCH , 0 ;End of switch list ;This MUST be here and must be last!!! .SBTTL Pure data .PSECT PURE,D DEFAST::.WORD 5 ;Default number of columns for fast listing DEFLST::.WORD 2 ;Default number of columns for normal listing DEFELD::.WORD 5 ;Default number field width on output .NLIST BEX ;List of month names for date switches ; and conversion routines MONTHS::.RAD50 \BADJANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC\ .WORD 0 VERSON::.NLCSI PATLEV=:.-2 CRLF:: .BYTE 0 .LIST BEX .EVEN SVAL:: ;Values for the sort switch SNAM:: .RAD50 \NAM\ STYP:: .RAD50 \TYP\ SDAT:: .RAD50 \DAT\ SSIZ:: .RAD50 \SIZ\ SPOS:: .RAD50 \POS\ .WORD 0 .PSECT CLEAR,D ;+ ; ; CLRLST ; The following list is referenced by INIT to clear the locations on program ; start up and restart. It MUST be physically located AFTER the switch ; declarations, and must end in a zero word. The switch declarations each ; add a word to the list. ; ;- .WORD COLCNT .WORD CORE .WORD DCNT .WORD DEVCT .WORD DEVLP .WORD DEVMT .WORD DEVSEQ .WORD DEVTT .WORD EBLOCK .WORD EOSFLG .WORD FCNT .WORD FSPEC .WORD FSPEC+INSPST .WORD HISEG .WORD IBUF .WORD INSPCS .WORD JFLAG .WORD JDAY .WORD JMON .WORD JYEAR .WORD KFLAG .WORD KDAY .WORD KMON .WORD KYEAR .WORD MABBAD .WORD NEWLIN .WORD OBLK .WORD OBUF .WORD PATS .WORD SBCNT ;CG08 .WORD SBLOCK .WORD SPATS .WORD TBLOCK .WORD UFLAG ;008 .WORD UDAY .WORD UMON .WORD UYEAR .WORD 0 .SBTTL Impure data ;+ ; ; Impure data ; The following section contains all the global impure data used by DIR. ; ;- .PSECT IMPURE,D AVAIL:: .WORD 0 ;Number of available directory segments COLCNT::.WORD 0 ;Number of columns output so far CORE:: .WORD 0 ;Flag to indicate if we can get more memory DCNT:: .WORD 0 ;Number of files in current directory segment DEFTYP::.WORD 0 ;Default listing type for file sizes DEFSIZ::.WORD 0 ;Default field width for file sizes DEVCT:: .WORD 0 ;Flag to indicate cassette input DEVLP:: .WORD 0 ;Flag to indicate line printer output DEVMT:: .WORD 0 ;Flag to indicate magtape input DEVSEQ::.WORD 0 ;Flag to indicate sequential output device DEVTT:: .WORD 0 ;Flag to indicate TT: output EBLOCK::.WORD 0 ;Total count of free blocks EOSFLG::.WORD 0 ;Flag to indicate end-of-segment encountered FCNT:: .WORD 0 ;Total count of files FREEND::.WORD 0 ;Pointer to end of usable memory INDEND::.WORD 0 ;Pointer past end of index table ;007 INDST:: ;INDST is same as FREEPT ;007 FREEPT::.WORD 0 ;Pointer to first free location in memory FREEST::.WORD 0 ;Pointer to first location above program HISEG:: .WORD 0 ;Highest directory segment in use INSPCS::.WORD 0 ;Number of input specs given MABBAD::.WORD 0 ;Flag to indicate a maybe-bad-directory NEWLIN::.WORD 0 ;Flag to indicate a has been printed NXTDSG::.WORD 0 ;Next directory segment to read NXTFIL::.WORD 0 ;Pointer to next directory entry OBLK:: .WORD 0 ;Output block number OLOC:: .WORD 0 ;Pointer to current location in output buffer RBLK:: .WORD 0 ;Physical block to read SAVESP::.WORD 0 ;Starting stack value SBCNT:: .WORD 0 ;Number of sort blocks in use ;CG08 SBLOCK::.WORD 0 ;Starting block number of current file TBLOCK::.WORD 0 ;Total number of used blocks XTRABY::.WORD 0 ;Number of extra bytes in directory entry ;***** The following words must be in this order ***** DAY:: .WORD 0 ;Current date (0-31) MON:: .WORD 0 ;Current month (0-12) YEAR:: .WORD 0 ;Current year (72-??) UDATE:: UYEAR:: .WORD 0 ;User entered year for /DATE (/D) UMON:: .WORD 0 ;User entered month UDAY:: .WORD 0 ;User entered date TDAY:: .WORD 0 ;Temp day used in date conversions TMON:: .WORD 0 ;Temp month TYEAR:: .WORD 0 ;Temp year KDATE:: KYEAR:: .WORD 0 ;User entered year for /BEFORE (/K) KMON:: .WORD 0 ;User entered month KDAY:: .WORD 0 ;User entered date JDATE:: JYEAR:: .WORD 0 ;User entered year for /SINCE (/J) JMON:: .WORD 0 ;User entered month JDAY:: .WORD 0 ;User entered date ;***** End of order dependent area ***** JFLAG:: .WORD 0 ;/SINCE processing flag KFLAG:: .WORD 0 ;/BEFORE processing flag UFLAG:: .WORD 0 ;/DATE processing flag ;009 TIME:: .BLKW 2 ;Time block DEFEXT::.WORD R50STR ;Default extensions "*" .RAD50 \DIR\ ;Output "DIR" .BLKW 2 ;Other outputs don't exist LKBLK:: .BLKW 4 ;Used in .LOOKUP's and magtape .SPFUN's XQUE:: .BLKW 10. ;Extra queue element CHARS:: .BLKW 6 ;Current directory filename in ASCII SPATS:: .BLKW 6 ;"START AT" option filename in ASCII IOAREA::.BLKW 12 ;EMT area block NFSLBK::.WORD 0,0,0,0 ;Lookup block for NFS access by ; LTRANP routine CSTABK::.BLKW 6 ;.CSTAT information return area ; for LTRANP routine PATS:: .BLKW 41 ;Input filenames in ASCII FSPEC:: .BLKW 47 ;CSI file spec area BUFFER::.BLKW 51 ;Line buffer OBUF:: .BLKW 400 ;Output buffer IBUF:: .BLKW 1000 ;Input buffer LIMIT:: .LIMIT .END