Interrupt 21h Function 7147h

Copies the path of the current directory for the given drive to the buffer. The copied path does not include the drive letter or the leading backslash.

mov ax, 7147h       ; Get Current Directory
mov dl, Drive       ; see below
mov si, seg Buffer  ; see below
mov ds, si
mov si, offset Buffer
int 21h

jc  error

Parameters

Drive
Drive number. This parameter can be 0 for current drive, 1 for A, 2 for B, and so on.
Buffer
Address of the buffer that receives the path. The buffer must be at least as big as the maximum allowed path for this volume as returned by Get Volume Information (Interrupt 21h Function 71A0h).

Return Value

Clears the carry flag and copies the path if successful. Otherwise, the function sets the carry flag and sets the AX register to an error value.