kolibrios/programs/other/personal/inc/mouse.inc
Akyltist ffd240bc4f Add sources codes "Personalization desktop" program. v 0.1
git-svn-id: svn://kolibrios.org@4813 a494cfbc-eb01-0410-851d-a64ba20cac60
2014-04-10 07:32:31 +00:00

31 lines
1.2 KiB
PHP

mouse_local:
;.................................................................................................
; Ïîëó÷àåì êîîðäèíàòû ìûøè îòíîñèòåëüíî îêíà
;.................................................................................................
mov eax,37 ; Ôóíêöèÿ 37 - ðàáîòà ñ ìûøüþ
mov ebx,1 ; íàì íóæíû ãëîáàëüíûå êîîðäèíàòû
int 0x40 ; eax = x*65536 + y, (x,y)=êîîðäèíàòû êóðñîðà ìûøè
mov ecx,eax ;
shr ecx,16 ; ecx = x+1
movzx edx,ax ; edx = y+1
dec ecx ; ecx = x
dec edx ; edx = y
mov [mouse_x],ecx ; mouse_x = x
mov [mouse_y],edx ; mouse_y = y
ret ; Âîçâðàùàåì óïðàâëåíèå
;end_mouse_local
mouse_left:
pusha
xor ecx,ecx
mov eax,37
mov ebx,2
int 0x40
cmp al,1
jne @f
mov ecx,1
@@:
mov [mouse_l],ecx
popa
ret
;end