Delete a file using assembly programming.


 Write a program to delete a file assembly program.

 Write assembly program to delete a file.

 Delete a file using assembly programming.

 Program:-

;delete file

printstring macro msg

mov ah,09h

mov dx,offset msg

int 21h

endm

data segment

imsg db 13,10,"Enter name of the file to delete : $"

smsg db 13,10,"  !! Success  !!$"

fmsg db 13,10,"  !! Faliure !!$"

dname db 20 dup(0)

data ends

 

code segment

assume cs:code,ds:data

 

start:

mov ax,data

mov ds,ax

printstring imsg

mov si,offset dname

 

ri:

 mov ah,1

int 21h

cmp al,13

je crd

mov [si],al

inc si

jmp ri

 

crd:

 mov ah,41h

 

 mov dx,offset dname

 int 21h

jnc succ

 

printstring fmsg

jmp exit

 

succ:printstring smsg

 

exit:

mov ah,4ch

int 21h

code ends

end start

No comments:

Post a Comment