; This file updates SRDOPR.MAC;1 from SRD V6.3. SRDOPR.MAC;2/AU=SRDOPR.MAC;1 \ -/.IDENT/,. .IDENT -6.4- ; DEC-83 .ENABL LC -/CEF001/+1 ; ; ; VERSION 6.4 - 07-Nov-83 (;BT003) ; ; Bob Turkelson ; SRD Working Group ; ; Correct calculation of number of memory blocks to extend ; task so that upper bits are cleared if sign bit propagation ; has occurred. (Previously had memory protection violation ; for a sufficiently large directory since task would shrink.) ; Added the /FO:[g,m] switch to select files by file owner, with ; /FO defaulting to files owned by the directory being listed; ; may be negated to select files with different file owners. ; Form a UIC string when the directory is opened in SRDOPR for ; use in UIC headings and diagnostic messages. % -,,/;BT003/ -/SRDOPR:/ CLR LENNTV ; Zero length of name-type-version -/7$:/ -/,SAVDID+2/ MOV #UFDFDB+F.FNAM,R3 ; Point to first half of directory name MOV (R3)+,R1 ; Get first half of directory name (group) MOV #GRPASC,R0 ; Point to area for ASCII string for group CALL $C5TA ; Convert group from RAD50 to ASCII INC R0 ; Jump over byte between group, member strings MOV (R3),R1 ; Get last half of directory name (member) CALL $C5TA ; Convert member from RAD50 to ASCII MOV #GRPASC,R0 ; Point to ASCII string for group CALL $COTB ; Convert group to binary MOVB R1,GRPBIN ; Store group number (binary) CALL $COTB ; Convert member to binary MOVB R1,MEMBIN ; Store member number (binary) BIT #FOSW,SWMS3$ ; File owner checking specified? BEQ 701$ ; EQ - no MOVB FOGBF$,FOGRP$ ; Get first value from /FO switch MOVB FOMBF$,FOMEM$ ; Get second value from /FO switch TSTB FOGRP$ ; Wild card group specified? BNE 701$ ; NE - no TSTB FOMEM$ ; Wild card member specified? BNE 701$ ; NE - no MOVB GRPBIN,FOGRP$ ; Both wild cards means use directory group MOVB MEMBIN,FOMEM$ ; and member in /FO and /-FO selection 701$: MOV #UICHD,R0 ; Point to UIC string for heading MOVB #'[,(R0)+ ; Move in UIC delimiter MOVB GRPBIN,R1 ; Get directory group (binary) CLR R2 ; Set leading zero suppression flag CALL $CBTMG ; Convert byte to ASCII MOVB #',,(R0)+ ; Move in separator MOVB MEMBIN,R1 ; Get directory member (binary) CLR R2 ; Set leading zero suppression flag CALL $CBTMG ; Convert byte to ASCII MOVB #'],(R0)+ ; Terminate UIC CLRB (R0) ; Indicate end of string -/16$:/ -/BEQ...99$/,. BNE 18$ ; NE - non-zero length directory JMP 99$ ; Skip over zero length directory 18$: -/30$:/ -/SUB...R0,R1/ -/.IF DF...R$$11M/,. .IF DF R$$11M&D$$CAL ; If on RSX-11M and dynamic checkpoint alloc -/BEQ...40$/ MOV R0,R2 ; Save size of existing buffer -/.ENDR...;6/ ; Here we need to clear the upper bits of R0 (the number of 64-byte blocks to ; extend or shrink the task) if the task is being extended by more than ; 100000 octal bytes since the shift-right instructions propagate the sign ; bit (otherwise the task would shrink rather than expand). However, we can ; not clear these bits if the task really should shrink. ; If the existing buffer size is >= 100000 octal bytes, or if the number of ; bytes to read is less than 100000, we won't be expanding by 100000 bytes ; or more, so there is no need to clear the upper bits. ; If the buffer size is less than 100000 and the number of bytes to read is ; at least 100000, the task will definitely expand rather than shrink, so ; it does not hurt to clear the upper bits (and is necessary if the extension ; is at least 100000). TST R2 ; Is existing buffer size >= 100000 octal bytes? BLT 33$ ; LT - yes, no need to clear upper bits TST R3 ; Is number of bytes to read < 100000 octal? BGE 33$ ; GE - yes, no need to clear upper bits BIC #176000,R0 ; Clear upper bits in case sign bit propagated 33$: -/35$:/ -/.ENDC...;R$$11M/,. .ENDC ;R$$11M&D$$CAL /