Circle, mouse v Assembleru

Kategorie >>Programování>> Circle, mouse v Assembleru


;kompilujte to treba v tasm a linknete tlinkem, co vam ale budu povidat,ze
; ne uplne vse funguje, ale neco jo :)

.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

;include _test.inc
;include _DODELAT.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 ?

mP db 0



.code



start:
jmp zacatek
include _graph.incObrázek
include _text.inc
INCLUDE _SYS.INC
include _proc.inc
include _file.inc

;______________________________________________________________________________________________


Copy_Video_Mem Macro policko,kolik_byte
PushA
mov cx,kolik_byte
mov si,0a000h
mov ds,si
xor si,si


mov di,@data
mov es,di
mov di,offset policko
rep movsb ; z DS:SI -> ES:DI; opakoj CX krat
PopA
endM

;--------------------------------------------
Paste_Video_Mem Macro policko,kolik_byte
PushA
mov cx,kolik_byte
mov di,0a000h
mov es,di
xor di,di


mov si,@data
mov ds,si
mov si,offset policko
rep movsb ; z DS:SI -> ES:DI; opakoj CX krat
PopA
endM

;*************************************************

zacatek:

printS_endln Txt_nazev
pause
CALL BEEP

getvideomode ;ve video_mode vysledek 1

call STARTmouse
init_320x200
mouse_stat m_xp,m_Yp,m_b
; get_m_pozadi m_xp,m_yp
; SET_M_CURSOR m_xp,m_yp
set_m_xy 100,100

get_pixel m_xp,m_yp,Mp
xchg ax,cx
pause
pixel m_xp,m_yp,5


@myska:

mouse_stat m_x,m_y,m_b
cmp m_b,1
je @vyskok ;pokud zmackl button
mov ax,m_xp
mov bx,m_yp

cmp ax,m_x
jne @delej

cmp bx,m_y
jne @delej

jmp @preskok

@delej:
; SET_M_pozadi m_xp,m_yp
; pixel m_xp,m_yp,mP
mov m_xp,ax
mov m_yp,bx
; get_pixel m_x,m_y,mp
; pixel m_x,m_y,4
circle m_x,m_y,3,4
; get_m_pozadi m_x,m_y
; SET_M_CURSOR m_x,m_y
; call beep
@preskok:


jmp @myska
@vyskok:

create_openF file_01,f_handle01
copy_All_video_mem pom_dup
Block_write pom_dup,64000,f_handle01,f_IORES ;zapis do souboru
close_File f_handle01,f_iores

init_text_mode

endln

endln
;***************************************************************************
konec:
mov ah, 4ch ;ukonceni programu a navrat zpet do systemu
int 21h
end start




Vloženo: 23.02.2007 00:33
Přečteno:2345
Autor: David Mizera

Hlasů: 0 Hodnocení(jako ve škole): nehlasováno
 

Komentáře (0)

   -     Nový Komentář