Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- model small
- .386
- .stack 100h
- .data
- descr dw 0
- temp db 18 dup(0)
- elems dw 18
- color db 04Eh
- fname db 't.txt'
- workErrMsg db 'Error while reading file$'
- string db 'Test'
- .code
- work proc
- mov ah, 3dh
- mov al, 0
- mov dx, offset fname
- int 21h
- jc errwork
- mov descr, ax
- mov ah, 3Fh
- mov bx, descr
- mov cx, elems
- lea dx, temp
- int 21h
- jc errwork
- mov ah, 3eh
- mov bx, descr
- int 21h
- jnc endRd
- errwork:
- mov ah, 09h
- mov dx, offset workErrMsg
- int 21h
- endRd:
- ret
- work endp
- start:
- mov ax,@data
- mov ds, ax
- call work
- mov ax, 3h
- int 10h
- mov cx, elems
- mov si, 0
- mov di, 0
- mov ax, 0B800h
- mov es, ax
- cycle:
- mov al, temp[si]
- mov es:[di], al
- add di, 1
- mov al, color
- mov es:[di], al
- add di, 1
- add si, 1
- loop cycle
- mov ax, 4C00h
- int 21h
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement