Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- code_seg segment
- assume cs:code_seg,ds:code_seg,ss:code_seg
- org 100h
- start:
- jmp begin
- handler DW ?
- norm DB 'All right',10,13,'$'
- ploho DB 'All wrong$'
- filename DB 'C:\fileok.txt',0h
- buffer db 80 dup('0')
- begin:
- ;открытие файла
- mov ah, 3Dh
- mov al, 0
- mov dx, offset filename
- int 21h
- jc Error
- mov dx, offset norm
- jmp write
- Error:
- mov dx, offset ploho
- write:
- mov ah, 09h
- int 21h
- ;чтение
- mov ah,3fh
- mov cx, 80h
- mov dx, offset buffer
- int 21h
- mov bx, offset handler
- add bx, ax
- int 21h
- mov ah,3Eh
- mov bx, offset handler
- int 21h
- jmp exit
- exit:
- mov ah,04ch
- mov al,0h
- int 21h
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement