Advertisement
Guest User

Untitled

a guest
Feb 6th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. code_seg segment
  2. assume cs:code_seg,ds:code_seg,ss:code_seg
  3. org 100h
  4. start:
  5.  
  6. jmp begin
  7. handler DW ?
  8. norm DB 'All right',10,13,'$'
  9. ploho DB 'All wrong$'
  10. filename DB 'C:\fileok.txt',0h
  11. buffer db 80 dup('0')
  12. begin:
  13.  
  14. ;открытие файла
  15. mov ah, 3Dh
  16. mov al, 0
  17. mov dx, offset filename
  18. int 21h
  19. jc Error
  20. mov dx, offset norm
  21.  
  22. jmp write
  23. Error:
  24. mov dx, offset ploho
  25. write:
  26. mov ah, 09h
  27. int 21h
  28.  
  29. ;чтение
  30. mov ah,3fh
  31. mov cx, 80h
  32. mov dx, offset buffer
  33. int 21h
  34. mov bx, offset handler
  35. add bx, ax
  36.  
  37.  
  38. int 21h
  39. mov ah,3Eh              
  40. mov bx, offset handler        
  41. int 21h                      
  42. jmp exit
  43.  
  44.  
  45.  
  46. exit:
  47. mov ah,04ch
  48. mov al,0h
  49. int 21h
  50. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement