[50,10]DIRFND.MAC/-AU=[50,10]OLDDIRFND.MAC -1,1 $BEGIN DIRFND,<32.0B>, -27 ; Johnny Billquist 18-May-1993 ; BQT001 - Added subdirectory structure -36 ; If a directory spec ends on a period, this will work down recursively. -110,110 MOV #6,R3 ; Set end of string. -119,122 CMP R3,#64. ; Is length valid? (Allow 64 bytes) BHI 40$ ; If HI then too long or negative INC R2 ; Skip bracket SUB #2,R3 ; End remove bracket from length -126,126 20$: MOV #4,N.DID(R1) ; Look it up in the MFD MOV #4,N.DID+2(R1) ; MOV R2,R5 ; ; Scan filename for end of this part of directory name. ; 21$: MOV R5,-(SP) ; Save pointer. CLR R4 ; Clear length. 22$: CMPB #'.,(R5) ; Check for valid end of dir. BEQ 23$ CMPB #'],(R5) BEQ 23$ CMPB #'>,(R5) BEQ 23$ INC R5 ; Bump pointer. INC R4 ; Bump length. SOB R3,22$ ; And loop. ; 23$: CMP R4,#9. ; Set length to 9 if larger than 9. BLE 24$ MOV #9.,R4 24$: MOV (SP)+,R2 ; Restore source pointer. MOV R3,-(SP) ; Save rest of length. MOV R5,-(SP) ; Save pointer to current place of directory string. MOV R4,R3 ; Get length of current dir into R3. MOV R1,R4 ; Copy pointer to FNB -132,138 BCS 401$ ; If CS then syntax error MOV #^RDIR,N.FTYP(R1) ; Fill in the rest of the directory MOV #0,N.FVER(R1) ; name, .DIR;0 CALL ..FIND ; Find the ID for this directory name BCS 501$ ; If CS then error exit -150,154 CLR (R4)+ MOV (SP)+,R5 ; Restore pointer to directory path. MOV (SP)+,R3 ; Restore directory length. BEQ 25$ ; End of string... 241$: CMPB #'.,(R5) ; Are we passing by some part which is ignorable? BNE 21$ ; No. 242$: INC R5 ; Skip this character. SOB R3,241$ ; Get next, if any left. ; 25$: ASSUME N.FNAM,N.FID+6 ASSUME N.FTYP,N.FNAM+6 ASSUME N.FVER,N.FTYP+2 MOV #5,R2 ; Zero next five words 30$: CLR (R4)+ ; N.FNAM, N.FNAM+2, N.FNAM+4 -159 501$: ADD #4,SP ; Error when stuff are on stack. BR 50$ 401$: ADD #4,SP ; Error when stuff are on stack... /