My program just can't get the mouse position correctly. I have tried two cases, the first: - No mouse reset - Code:
WAIT_FOR_CLICK:
; CHECK IF THE MOUSE IS CLICKED
MOV AX,3H
MOV BX, 0
INT 33H
CMP BX, 0
JZ WAIT_FOR_CLICK
; DISPLAY CLICK POSITION
MOV AL, 5
MOV AH, 0CH
INT 10H
This case always produces the same coordinate no matter where I click.
Second case, with mouse reset:
; RESET THE MOUSE
MOV AX, 0
INT 33H
; SHOW THE MOUSE POINTER
MOV AX, 1
INT 33H
WAIT_FOR_CLICK:
; CHECK IF THE MOUSE IS CLICKED
MOV AX,3H
MOV BX, 0
INT 33H
CMP BX, 0
JZ WAIT_FOR_CLICK
MOV AL, 5
MOV AH, 0CH
INT 10H
In this case, the mouse position varies. It isn't accurate at all (probably because I am using a super VGA video mode with 800x600 resolution) but I think it can be fixed with some scaling. The problem is, whenever I click the mouse, the pointer disappears and the mouse click isn't recorded. However, the second click is recorded. The mouse pointer stays hidden no matter what I do ( I put the call to INT 33H, 1 literally everywhere in the code and it still gets hidden once I click ). I am using Turbo GUI Assembler, any help please?
p.s I tried running the executable file using dosbox instead of inside the GUI Assembler, same results. I also tried a different assembler, same.