Guest User

Untitled

a guest
Nov 20th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. ; For deletion of file AH=41H
  2. ; INT 21H Interrupt is used
  3. ; Note: File Wont be deleted in Windows 7,8, when C drive is used. Permission and Stuff.
  4. ; Note: Fill will only be deleted if the path given contains the folder. Since Folder is not created.
  5.  
  6. ; Declaration Part
  7. .MODEL SMALL
  8. .DATA
  9. FILE DB 'C:\SPP.DOC',0 ; File Path (Note: Folders are not created, so always create a file inside existing folderor drive). 0 is used to append the file
  10. MSG DB 'File Deleted','$' ; To display successful message when File is deleted
  11. .CODE
  12. START: MOV AX,@DATA
  13. MOV DS,AX
  14.  
  15. ;File Deletion Part
  16. LEA DX,FILE ; Load the file path to DX
  17. MOV AH,41H ; Delete the File, AH=41H
  18. INT 21H
  19.  
  20. ;Display Part
  21. JC EXIT ; If carry Flag is Set, It means File is not Deleted
  22. LEA DX,MSG ; Load the Success Message
  23. MOV AH,09H
  24. INT 21H
  25.  
  26. ;Termination Part
  27. EXIT:MOV AH,4CH ; Terminate the Program
  28. INT 21H
  29. END START
Add Comment
Please, Sign In to add comment