Category : File Managers
Archive   : WCD.ZIP
Filename : WCD.ASM

 
Output of file : WCD.ASM contained in archive : WCD.ZIP
;WCD v1.0
;Will Hobday
;Oct-22-1990


jmp Change_Directory

;-------------------------------------------------------------------------------

FILENAME db ' :*.',0
BUFFER db 8 dup(0)
POINTER dw ?
LENGTH dw ?

;-------------------------------------------------------------------------------

Change_Directory PROC
mov cx,64
mov si,080
mov di,offset COMMAND_LINE
rep movsw

mov AX,1900H ;Get current disk drive
int 21H
add AL,65 ;Make it into a letter
mov [filename],AL ;Put it in its place

mov bx,offset COMMAND_LINE
inc bx
mov pointer,bx
cmp byte [es:bx-1],0
je GO_FIRST
ML2:
call Get_Search_String
jc LAST_STRING
call Up_Case
jc ML2
call Find_First_Directory
jc EXIT
call Is_Match
jnc SET_DIR
ML1:
call Find_Next_Directory
jc EXIT
call Is_Match
jc Ml1
jmp SET_DIR

GOOD_EXIT:
mov ah,03B
mov dx,09E
int 021
EXIT:
int 020

;-------------------------------------------------------------------------------

SET_DIR:
mov ah,03B
mov dx,09E
int 021
jmp Ml2

;-------------------------------------------------------------------------------

GO_FIRST:
call Find_First_Directory
jc EXIT
call Find_Next_Directory
jc EXIT
call Find_Next_Directory
JC EXIT
jmp GOOD_EXIT

;-------------------------------------------------------------------------------

LAST_STRING:
call Up_Case
call Find_First_Directory
jc EXIT
call Is_Match
jnc GOOD_EXIT
ll1:
call Find_Next_Directory
jc EXIT
call Is_Match
jc ll1
jmp GOOD_EXIT

Change_Directory ENDP

;-------------------------------------------------------------------------------

Find_First_Directory PROC
mov dx,offset FILENAME
mov cx,010
mov ax,04E00
int 021
JC NOT_FOUND
clc
ret
NOT_FOUND:
stc
ret
Find_First_Directory ENDP

;-------------------------------------------------------------------------------

Find_Next_Directory PROC
mov bx,095
NO_DIR:
mov ah,04F
int 021
jc NO_MORE
cmp byte [es:bx],010
jne NO_DIR
clc
ret
NO_MORE:
stc
ret
Find_Next_Directory ENDP

;-------------------------------------------------------------------------------

Get_Search_String PROC
mov si,POINTER
l4:
mov di,offset BUFFER
mov cx,4
xor ax,ax
rep stosw
mov di,offset BUFFER
mov cx,8
L3:
lodsb
cmp al,'\'
je L2
cmp al,'/'
je L2
cmp al,' '
je l2
cmp al,0D
je NO_MORE_DATA
l1:
stosb
loop L3
l2:
cmp cx,8
je L4
mov LENGTH,8
sub LENGTH,cx
mov POINTER,si
clc
ret
NO_MORE_DATA:
mov LENGTH,8
sub LENGTH,cx
stc
ret
Get_Search_String ENDP

;-------------------------------------------------------------------------------

Is_Match PROC
mov cx,LENGTH
inc cx
mov di,09E
mov si,offset BUFFER
repe cmpsb
cmp cx,0
jne Here
clc
ret
Here:
stc
ret
Is_Match ENDP

;-------------------------------------------------------------------------------

Up_Case PROC
mov cx,LENGTH
cmp cx,0
je NO_CHARS
mov bx,cx
dec bx
CASE_LOOP:
cmp byte buffer[bx],'a'
jb NO_CONVERT
cmp byte buffer[bx],'z'
ja NO_CONVERT
sub byte buffer[bx],020
NO_CONVERT:
dec bx
loop CASE_LOOP
clc
ret
NO_CHARS:
int 05
stc
ret
Up_Case ENDP

;-------------------------------------------------------------------------------

COMMAND_LINE:


  3 Responses to “Category : File Managers
Archive   : WCD.ZIP
Filename : WCD.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/