proc UseMouse
push ax ; mouse register
push cx ; x cordinates (for future submarine)
push dx ; y cordinates (for future submarine)
mov ax,0h
int 33h
mov ax,1h
int 33h
mov ax,3h
int 33h
shr cx,1
wait_for_leftclick:
cmp bx, 01h
je loop3
jmp wait_for_leftclick
loop3:
Tnai1:
cmp al, 4
je Printsub1
jmp Tnai2
Tnai2:
cmp al, 5
je printsub2
jmp Tnai3
Tnai3:
cmp al, 6
je printsub3
jmp printsub4
Tnai4:
cmp al, 7
je Printsub4
jmp Tnai5
Tnai5:
cmp al, 8
je Printsub5
jmp wait_for_leftclick
Printsub1:
mov ax, 3h
int 33h
shr cx, 1
mov [Var1], cx
mov [Var2], dx
push 23
push 40
push 4
push [Var2]
push [Var1]
push offset submarine1
call Sprite_Figure
printsub2:
mov ax, 3h
int 33h
shr cx, 1
mov [Var1], cx
mov [Var2], dx
push 23
push 40
push 4
push [Var2]
push [Var1]
push offset submarine2
call Sprite_Figure
printsub3:
mov ax, 3h
int 33h
shr cx, 1
mov [Var1], cx
mov [Var2], dx
push 23
push 40
push 4
push [Var2]
push [Var1]
push offset submarine3
call Sprite_Figure
printsub4:
mov ax, 3h
int 33h
shr cx, 1
mov [Var1], cx
mov [Var2], dx
push 23
push 40
push 4
push [Var2]
push [Var1]
push offset submarine4
call Sprite_Figure
Printsub5:
mov ax, 3h
int 33h
shr cx, 1
mov [var1], cx
mov [var2], dx
push 23
push 40
push 4
push [Var2]
push [Var1]
push offset submarine5
call Sprite_Figure
pop ax
pop cx
pop dx
ret
endp UseMouse
This is the function
mov ah, 5
timeX5:
dec ah
call UseMouse
cmp ah, 0
jne timeX5
This is how i call the function
This function checks which submarine was chosen (by cliking on it with the left mouse button, each submarine is in different color) and prints the same one on the chosen place on screen.
The problem is that after clicing once on the submarine and then on screen nothing happened:(
I tried looking on the internt about the mouse functions (int 33h), also to td it
Thanks in advance:))