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 1.04 KB | None | 0 0
  1. ; For creation of file AX=3C00H
  2. ; CX=0000H
  3. ; INT 21H Interrupt is used
  4. ; Note: File Wont be created in Windows 7,8, when C drive is used. Permission and Stuff.
  5. ; Note: Fill will only be created if the path given contains the folder. Since Folder is not created.
  6.  
  7. ; Declaration Part
  8. .MODEL SMALL
  9. .DATA
  10. 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
  11. MSG DB 'File created','$' ; To display successful message when File is created
  12. .CODE
  13. START: MOV AX,@DATA
  14. MOV DS,AX
  15.  
  16. ;File Creation Part
  17. MOV AL,00H ; For file creation, AX=3C00H and CX=0000H
  18. MOV AH,3CH
  19. LEA DX,FILE ; Load the file path to DX
  20. MOV CX,0000H ; Create the File, AX=3C00H
  21. INT 21H
  22.  
  23. ;Display Part
  24. JC EXIT ; If carry Flag is Set, It means File is not Created
  25. LEA DX,MSG ; Load the Success Message
  26. MOV AH,09H
  27. INT 21H
  28.  
  29. ;Termination Part
  30. EXIT:MOV AH,4CH ; Terminate the Program
  31. INT 21H
  32. END START
Add Comment
Please, Sign In to add comment