INT 21h AH=47h copies the current directory of a drive into the buffer at DS:SI. The buffer is in SI, not DX as in most services. What comes back is the path in capitals, ending with a 0 byte, with neither the drive nor the backslash after it:

Current directoryThe buffer
C:\0 (an empty string)
C:\TOOLS"TOOLS", 0
C:\TOOLS\BIN"TOOLS\BIN", 0

To show a full path, print the drive letter (from INT 21h AH=19h), ":\", then the buffer. 64 bytes are always enough: DOS does not let a path, drive included, grow beyond 64 characters. The drive is numbered from 1 = A, with 0 for the current drive; a drive that does not exist gives CF = 1 and AX = 15 (0Fh, invalid drive). On success MS-DOS happens to return AX = 0100h, and DOSBox-X does the same, but nothing promises it.

prints the directory the program runs in (C:\ in the root, C:\WORK in a directory WORK), then: drive 27: error 15
MOV AH, 47h ; DOS: the current directory of drive DL
MOV DL, 0 ; 0 = the current drive, 1 = A
MOV SI, OFFSET PATH1 ; DS:SI = 64 bytes for the path
INT 21h
MOV AH, 19h ; 47h leaves out the drive: print it first
INT 21h
ADD AL, "A"
MOV DL, AL
MOV AH, 02h
INT 21h
MOV DL, ":"
MOV AH, 02h
INT 21h
MOV DL, "\" ; and the backslash after it
MOV AH, 02h
INT 21h
CLD
MOV SI, OFFSET PATH1
NEXT1:
LODSB ; the path ends with a 0 byte
OR AL, AL
JZ DONE1
MOV DL, AL
MOV AH, 02h
INT 21h
JMP NEXT1
DONE1:
MOV DX, OFFSET CRLF
MOV AH, 09h
INT 21h
MOV DX, OFFSET BADM1
MOV AH, 09h
INT 21h
MOV AH, 47h ; a drive that cannot exist
MOV DL, 27
MOV SI, OFFSET PATH1
INT 21h
CALL RESULT ; error 15: invalid drive
PATH1 DB 64 DUP(0)
BADM1 DB "drive 27: $"
RESULT PROC NEAR ; print "ok", or "error" and AX when CF = 1
PUSHF ; keeps AX and CF for the caller
PUSH AX
MOV DX, OFFSET OKMSG
JNC RESULT1
MOV DX, OFFSET ERRMSG
MOV AH, 09h
INT 21h
POP AX
PUSH AX
CALL PDEC ; the error code
MOV DX, OFFSET CRLF
RESULT1:
MOV AH, 09h
INT 21h
POP AX
POPF
RET
RESULT ENDP
OKMSG DB "ok", 13, 10, "$"
ERRMSG DB "error $"
PDEC PROC NEAR ; print AX in decimal (changes AX BX CX DX)
MOV BX, 10
XOR CX, CX ; digits on the stack
PDEC1:
XOR DX, DX
DIV BX ; AX = AX / 10, DX = the last digit
PUSH DX
INC CX
OR AX, AX
JNZ PDEC1
PDEC2:
POP DX ; the digits come back first to last
ADD DL, "0"
MOV AH, 02h
INT 21h
LOOP PDEC2
RET
PDEC ENDP
CRLF DB 13, 10, "$"

47h always returns 8.3 names. In DOSBox-X a host folder with a long name appears as its generated short name, such as PROGRA~1, the name DIR shows and CD accepts. With long file names enabled, function 7147h of INT 21h returns the long form.