Documente Academic
Documente Profesional
Documente Cultură
stack segment
dw 128 dup(0)
ends
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
xor bx, bx
mov bl, buffer[1]
mov buffer[bx+4], '$'
mov dx, offset buffer + 2
mov ah, 9
int 21h
;deschidere fisier
mov al, 2
mov dx, offset nume_fisier
mov ah, 3dh
int 21h
jc eroare
mov handle, ax
jmp citire
eroare:
lea dx, mesaj_rau
mov ah, 09h
int 21h
citire:
scriere:
inlocuire:
; seek...
mov al, 1
mov bx, handle
mov cx, 0
mov dx, -1
mov ah, 42h
int 21h
;----------------scriere cu spatii-----------------
mov bx, handle
mov dx, offset spatiu+2
mov cl, spatiu+1
cmp buffer, 0Dh
je sfarsit
mov ah, 40h
int 21h
jmp linie_2
sfarsit:
; close file...
mov bx, handle
mov ah, 3eh
int 21h
proc citire_din_fisier
mov bx,handle
mov dx, offset buffer
mov cx, 1
end start