home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
USCX
/
DOSUT-09.ZIP
/
COTITL.ASM
< prev
next >
Wrap
Assembly Source File
|
1984-11-01
|
2KB
|
89 lines
TITLE COTITL - Diskette Contents List - Get Title
SUBTTL Version 1.1 - July 1984
PAGE 81,132
;
CODE SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:CODE,DS:CODE
;
EXTRN VERS:BYTE
;
PUBLIC TITLX,FREE
LSRCH DB '*.*',0
LB3 DB 'Label:'
TPRMT DB 13,10,'Enter Title: $'
TBUF DB 37,0 ;Input buffer for user title
DB 37 DUP (?)
TITLX DB 39 DUP (' ') ;Title line
LB1 DB 7 DUP (' ')
LB2 DB 13 DUP (' ') ;Label field
DB 'Free: '
FREE DB 9 DUP (' ') ;Formatted free space in title line
MONTH DB ' /' ;Date fields in title line
DAY DB ' /'
YEAR DB ' ',0 ;End of title
;
PUBLIC GETTTL
GETTTL PROC NEAR
MOV DI,OFFSET TITLX
MOV CX,59
MOV AL,' '
REP STOSB ;Clear title line
MOV DX,OFFSET TPRMT
MOV AH,9
INT 21H ;Prompt for title
MOV DX,OFFSET TBUF
MOV AH,0AH
INT 21H ;Get user title
MOV CL,TBUF+1 ;Load length
XOR CH,CH
MOV SI,OFFSET TBUF+2
MOV DI,OFFSET TITLX
REP MOVSB ;Move user title to title line
MOV AH,2AH
INT 21H ;Get date
SUB CX,1900 ;Convert to two digit year
MOV DI,OFFSET YEAR
MOV AL,CL
CALL DECMAL ;Fill in month/day/year
MOV DI,OFFSET MONTH
MOV AL,DH ; for title line
CALL DECMAL
MOV DI,OFFSET DAY
MOV AL,DL
CALL DECMAL
CMP VERS,3 ;See if Version 3 or later
JB TDNE ;No, so skip label
MOV DX,OFFSET LSRCH ;Check directory for label
MOV AH,4EH
MOV CX,8
INT 21H
JC TDNE ;No label
MOV SI,OFFSET LB3 ;Move in "Label:"
MOV DI,OFFSET LB1
MOV CX,6
REP MOVSB
MOV SI,9EH ;Move in diskette label
MOV DI,OFFSET LB2
MOV CX,11
LBLP: LODSB
OR AL,AL
JZ TDNE ;Label terminates with null
CMP AL,'.'
JE LBLP ;DOS insists on punctuation
STOSB
LOOP LBLP
TDNE: RET
GETTTL ENDP
;
DECMAL PROC NEAR ;Converts AL to two decimal
AAM ; digits and stores at SI
OR AX,'00'
XCHG AL,AH
STOSW ;Save in image
RET
DECMAL ENDP
;
CODE ENDS
;
END