I keep getting ax = 02h invalid component in directory path or drive letter only
Does anyone know why. Thanks.

.model small
.stack 200h

.data

CANONICALIZED_NAME db 128 dup(?)
file_size dd ?
name_size dw ?
file_name db 128 dup(?) ; DOS maximum path length
prompt db 13,10,'Enter File name -> $'

.code

start:
mov ah,15 ; clear the screen
int 10h
mov ah,0
int 10h

mov ax,@data
mov ds,ax
mov es,ax ; need for LFN functions

mov dx, offset prompt
mov ah,9
int 21h

mov file_name,128 ; max characters in input
mov dx,offset file_name; get filename
mov ah,0ch ; flush keyboard buffer
mov al,0ah ; buffered keyboard input
int 21h
mov cl, ; how many bytes read in
add cl,2 ; find position after last character
mov ch,00
mov si,cx ; move count to index register
mov ,cx ; save size
mov file_name,00 ; make into ASCII string


mov ah,60h ; determine the canonical name of the specified
; filename
; ax contains error code
; 02h invalid component in directory path or
; drive letter only
; 03h malformed path or invalid drive letter

lea si,file_name + 1
lea di,CANONICALIZED_NAME
int 21h
int 3


finito:
mov ax,4c00h ; Set errorlevel to 0
int 21h


end start
Posted on 2003-09-14 21:37:03 by skywalker