-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmouse.asm
More file actions
67 lines (49 loc) · 1021 Bytes
/
mouse.asm
File metadata and controls
67 lines (49 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.model Small
.stack 64
.data
x dw 320
y dw 240
.code
main proc NEAR
mov ax, @data
mov ds, ax
;-----------
mov ah,00h
mov al,13h ;modo grafico 640x480 pixeles
mov bh,00 ;pagina 0, color negro
int 10h
mov ah, 0bh
mov bh, 00h
mov bl, 01h ;color fondo
int 10h
; inicializa mouse
mov ax,00h
int 33h
cmp al,00h ; si no enontro driver se sale del programa
je salir
; muestra puntero de mouse
mov ax,01h
int 33h
; ubica el mouse
mov ax,04h
mov cx,x
mov dx,y
int 33h
; detecta estado del mouse
cursor:
mov ax,03h
int 33h
cmp bx,2 ; detecta click derecho y sale del programa
je salir
jmp cursor
salir:
mov ax,02h ;oculto raton
int 33h
mov ah,00h
mov al,03h
int 10h
; salir de DOS
mov ax, 4C00H
int 21h
main endp
end main