; VRAINOM.COM - utility using the DOS 60h undocumented feature.
; Display the path in a detailed form.
; masm vrainom;
; link vrainom;
; exe2bin vrainom vrainom.com
code segment
assume cs:code, ds:code
org 100h
Depart:
mov ah,30h ; Check DOS version -------------
int 21h
cmp al,3 ; At least DOS 3 ?
jb Vieux_DOS ; Else error
mov bx,81h ; DTA Start --------------------
mov si,bx
Cmp_blanc: ; Obtain the first non-white character ------
lodsb ; Character [DS:SI] in AL, if show follow.
cmp al,20h ; Space ?
jne Tab ; Else table maybe
Tab:
cmp al,9 ; Table ?
jne Suite ; Else no white character
jmp Cmp_blanc
Suite: ; Obtain the absolute path -----------
dec si ; First non-white characters
add bl,ds:80h ; Read number of characters in DTA
mov byte ptr [bx],0 ; Put the chain in ASCIIZ format
mov di,offset tampon
mov ah,60h ; Input of this function : DS:SI et ES:DI
int 21h
mov si,di ; Display the path -----------------
mov ah,2 ; Function to display characters
Sortie_car:
lodsb ; AL = [DS:SI] and IF increment
or al,al ; null characters ?
jz Fin ; If yes, end
mov dl,al
int 21h
jmp Sortie_car
Fin:
ret
Vieux_DOS:
mov ah,9
mov dx,offset msg_VieuxDOS
int 21h
ret ; End
tampon db 128 dup(0) ; Complete path in ASCIIZ format
msg_VieuxDOS db 13,10,'Require DOS 3 at least',13,10
code ends
end Start