;Create_fileP PROC ;v DS:DX je nazev souboru
;Create_file Macro nazev,handle
;Open_file Macro nazev,zpusob_otevreni,handle ;zp. otevreni -1,2,3 viz _def.inc (RWchyba ..kod chyby
RET
Block_writeP endP
;_______________________________________________________________________
Block_write_endLN Macro handle,vystup_OK ;zapis do souboru - konecradky
;DS:DX adresa bufferu k zapisu na disk
PushA
mov bx,handle
mov dx,@data ;pole je v data segmentu
mov ds,dx
mov dx,offset f_end_line
mov cx,2
mov bx,handle
call Block_WriteP
mov ax,pom_boolean
mov vystup_ok,ax
PopA
endM
;_______________________________________________________________________
Block_write Macro POLE_k_zapisu,pocet_bytu,handle,vystup_OK ;zapis do souboru
;DS:DX adresa bufferu k zapisu na disk
PushA
mov bx,handle
> mov dx,@data ;pole je v data segmentu
mov ds,dx
mov dx,offset POLE_k_zapisu
mov cx,pocet_bytu
mov bx,handle
call Block_WriteP
mov ax,pom_boolean
mov vystup_ok,ax
PopA
endM
;__________________________________________________________________
erase_file MACRO nazev,IORESULT
mov ah,41h ;maz soubor
mov dx,@data
mov ds,dx
mov dx,offset nazev
int 21h
mov IORESULT,AX
endM
;_______________________________________________________________________
set_file_attr macro nazev,attr,ioresult
mov ah,43h ;maz soubor
mov dx,@data
mov ds,dx
mov dx,offset nazev
mov cx,attr
mov al,1 ;nastav atributy
int 21h
mov IORESULT,AX
endM
;_______________________________________________________________________
get_file_attr macro nazev,attr,ioresult
mov ah,43h ;maz soubor
mov dx,@data
mov ds,dx
mov dx,offset nazev
xor al,al ;zjisti atributy
int 21h
mov IORESULT,AX
mov attr,cx
endM
;_______________________________________________________________________
seek_file macro handle,posunHI,posunLO ;seekHI:seekLO ...longint
mov ah,42h
mov bx,handle
mov cx,posunHI
mov dx,posunLO
mov al,0 ;pozice = 0 + CX:DX ;al=1 ..aktual pozice + posun,2konec souboru + posun
int 21h ;jinac posun = (cx*65536)+dx
endM
;_______________________________________________________________________
seek_file_start macro handle ;seekne na zacatek souboru
mov ah,42h
mov bx,handle
xor cx,cx ;CX:DX = 0
xor dx,dx
mov al,0
int 21h
endM
;_______________________________________________________________________
seek_file_END macro handle ;seekne na konec souboru
mov ah,42h
mov bx,handle
xor cx,cx ;CX:DX = 0
xor dx,dx
mov al,2 ;na konec souboru
int 21h
endM