样本输出:
我试图获得鼠标点击位置,但是当我点击屏幕时,鼠标变得隐藏,但点击获得正确的位置!尽管我使用了使鼠标光标可见的中断,但我还是显示了它们!我可以使鼠标可见还是必须通过获取位置来使自己的光标?
我的示例代码是:
include MainMacro.inc
.MODEL SMALL
.STACK 64
.DATA
OUTPUT1 DB 5 DUP('$')
OUTPUT2 DB 5 DUP('$')
OUTPUTS DB ' $'
.CODE
MAIN PROC FAR
MOV AX,@DATA
MOV DS,AX
MOV AX,4F02h ;OPEN 1280*1024 SCREEN
MOV BX,107h
INT 10h
mov ax,7 ;SET HORIZONTAL RANGE
MOV CX,0
MOV DX,1279
int 33h
mov ax,8 ;SET VERTICAL RANGE
MOV CX,0
MOV DX,1023
int 33h
;;;;;;;;;;;;;
mov ax, 1 ;TURN MOUSE CURSOR ON.
int 33h
;;;;;;;;;;;;;;
JMP MAINLOOP
REL0:
MOV AX,6
MOV BX,0
INT 33H
CMP BX,0
JNE REL0
JMP MOUSE ;IF LEFT BUTTON IS RELEASED
REL1:
MOV AX,6
MOV BX,1
INT 33H
CMP BX,0
JNE REL1
JMP MOUSE ;IF RIGHT BUTTON IS RELEASED
MOUSE:
PUSHA
REGISTER_TO_STRING 4 0AH CX OUTPUT1 ;PUT X THE VALUE IN OUTPUT
POPA
PUSHA
REGISTER_TO_STRING 4 0AH DX OUTPUT2 ;PUT Y THE VALUE IN OUTPUT
POPA
DISPLAY_STRING OUTPUT1
DISPLAY_STRING OUTPUTS
DISPLAY_STRING OUTPUT2
LINE_DOWN 1
MAINLOOP:
MOV AX,6 ;LEFT BUTTON PREESED
MOV BX,0
INT 33H
CMP BX,0
JNE REL0
MOV AX,6 ;RIGHT BUTTON PREESED
MOV BX,1
INT 33H
CMP BX,0
JNE REL1
JMP MAINLOOP
HLT
MAIN ENDP
END MAIN