home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
11a
/
cover20.zip
/
COORDR.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-01-21
|
2KB
|
78 lines
PAGE ,132
TITLE COORDR - Diskette contents list - Redefine Order
COMMENT * Version 1.0 - June 1983
(PER Dr. Dobbs Journal, January, 1984, #87)
(Dan Daetwyler "Sorted Diskette Directory for
the IBM PC")
Version 2.0 Bruce F. Cameron
Cincinnati OH
February 25, 1985
Counts hidden files
Grouped sort (i.e. all COM files first etc.)
Includes Volume Label and Directory (if not root)
Lists Subdirectory names
Free space up to 100M (hard disk) *
;
;
PAGE 82
;
; Request file extension entries which are to be sorted to the beginning of the list
;
CODE SEGMENT PARA PUBLIC 'CODE'
ASSUME CS:CODE, DS:CODE
;
EXTRN RELOC:BYTE
SPCHAR DB 80H ; Ordering character
XBUF DB 8,0 ; Input buffer for extension
DB 8 DUP (?)
XPRMT1 DB 13,10,'Enter file name extension to relocate$'
XPRMT2 DB 13,10,' to top of list ("\" to quit): $'
;
PUBLIC GETORD
GETORD PROC NEAR
MOV BP,0 ; Counter of entries
MOV DI,OFFSET RELOC
LOOP: MOV DX,OFFSET XPRMT1 ; Prompt for extension
MOV AH,9
INT 21H
MOV DX,OFFSET XPRMT2
MOV AH,9
INT 21H
MOV DX,OFFSET XBUF
MOV AH,0AH ; Get extension
INT 21H
CMP XBUF+2,5CH ; Check for done (\)
JE QUIT
MOV BL,XBUF+1 ; Get length
CMP BL,2
JNLE STOR
XOR BH,BH
MOV CX,BX
SUB CX,3
NEG CX ; Set loop count (3 - length of string)
PUSH DI
LEA DI,XBUF[BX+2] ; Points to char just after string
MOV AL,' ' ; Fill with blanks
REP STOSB ; to 3 characters
POP DI
STOR: MOV CX,3
MOV SI,OFFSET XBUF+2
REP MOVSB ; Extension from buffer to list
MOV AL,SPCHAR
STOSB ; Add `ordering' character
INC SPCHAR
INC BP ; Count entry
CMP BP,10
JL LOOP ; Cycle if 9 or fewer entries
QUIT: MOV BYTE PTR [DI],0 ; Terminator to end-of-list
MOV SPCHAR,80H ; Reset ordering character
RET
GETORD ENDP
;
CODE ENDS
;
END