.286
.model large,PASCAL
.code
JUMPS ;automaticky generuje misto napr jnz,coz je near jmp navesti a far jmp
;nemusi se to rozepisovat
.stack 1024
.data
include _def.inc
;tyto promenny nejsou ani v _def.inc. Je mozne je kdykoliv menit a pouzivat misto registru
pom_cas dw 0
pom_byte db 0
pom_word dw 0
Pom_dup db 64000 dup (?) ;i pro obr. pamet
;Pom_dup2 db 1024*16 dup (?) ;i pro obr. pamet
pom_boolean dw 0
pom_adr dw 0
Circle_Rval DW ?
Circle_X1 DW ?
Circle_Y1 DW ?
.code
start:
jmp zacatek
include _graph.inc
include _text.inc
INCLUDE _SYS.INC
include _proc.inc
include _file.inc
;______________________________________________________________________________________________
;--------------------------------------------
;*************** POZOR JESTE SEM TAM HAZE CHYBY, ASI PREDELAT
delayP Proc NEAR;milisekundy ulozene v promenne ms - dw ?
MOV AH,00h ;cti hodiny od resetu
int 1ah ;->v dx je nizsi pocet taktu (18.2 / s)
mov pom_cas,dx
xor dx,dx
MOV ax,ms ;nahravam jiz ulozene milisekundy
mov bx,55
div bx ;ax = milisekund/55 .. tj pocet taktu co pockat
add pom_cas,ax ;zkontrolovat zda nemuze generovat OF .. ono to nevadi, pac
;kdyz to pretece , tak to vlastne jede.. snad se to nevysere
otockaloop:
int 1ah
NOP
NOP ;abych to preruseni prilis nepredrel
NOP
cmp dx,pom_cas
jae vyskockaloop ;pokud vetsi nebo rovno casu, na kterej cekam konec
jmp otockaloop
vyskockaloop:
RET
DELAYP EndP
delay Macro milisek
pusha ;Save registers
mov ms,milisek
call DelayP
popa ;Restore registers
endM
;--------------------------------------------
Block_ReadP PROC NEAR
;DS:DX adresa bufferu k cteni z disku
mov pom_boolean,true ;v BX handle, v CX pocet ctenych bytu
mov ah,3fh
int 21h
CMP AX,CX ;zapsan stejnej pocet bitu?
jz koncet0
mov pom_boolean,false ;ne .. vysledek = 0 = false
koncet0: ;pokud nastavena vlajka CF ->chyba ..kod chyby
RET
Block_READP endP
Block_READ Macro POLE,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
mov cx,pocet_bytu
mov bx,handle
call Block_READP
mov ax,pom_boolean
mov vystup_ok,ax
PopA
endM
;--------------------------------------------
;--------------------------------------------
;--------------------------------------------
;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
;*************************************************
zacatek:
printS_endln Txt_nazev
pause
getvideomode ;ve video_mode vysledek 1
init_320x200
initmouse
cmp ax, 0fffh
jnz faklabrejle ;mys nepojede fakla sTARAa mama
mousecursorOn
faklabrejle:
; circle_stred 120,90,42,63
pause
create_openF file_01,f_handle01
;copy_All_video_mem pom_dup
;clrscr_320x200 0
;paste_All_video_mem pom_dup
;Block_write pom_dup,64000,f_handle01,f_IORES ;zapis do souboru
seek_file_start f_handle01
Block_read pom_dup,64000,f_handle01,f_IORES ;zapis do souboru
paste_All_video_mem pom_dup
close_File f_handle01,f_iores
;drawline 1,1,250,150,4
pause
init_text_mode
;init_NOVESA_mode video_mode
endln
printS_endln Txt_autor
printS_endln Txt_copyright
ENDLN
printS_endln Txt_co_myslis
ENDLN
getstr pom_dup,10
mezera 10
printS_endln Txt_haha
;fillS pom_dup,61,3 ;61 je '='
printS pom_dup
endln
;***************************************************************************
konec:
mov ah, 4ch ;ukonceni programu a navrat zpet do systemu
int 21h
end start