Category : Files from Magazines
Archive   : CGAZ3-1.ZIP
Filename : MOUSEIN2.ASM

 
Output of file : MOUSEIN2.ASM contained in archive : CGAZ3-1.ZIP

.MODEL small
.CODE

; Our program will read this data by referring to addresses relative
; to the procedure MouseData(). This must be declared as
;
; void far MouseData();
;
; After this, execute this code
;
; mouse_trap far *data;
; data = (mouse_trap *) MouseData;
;
; And now refs like data->what, data->buttons will work.
;
PUBLIC _MouseData

_MouseData LABEL FAR ; creates a fake procedure

What DW 0
Buttons DW 0
X_pos DW 0
Y_pos DW 0
X_mickeys DW 0
Y_mickeys DW 0

; our interrupt service routine
PUBLIC _handler
_handler PROC FAR
mov cs:What,ax ; load data
mov cs:Buttons,bx
mov cs:X_pos,cx
mov cs:Y_pos,dx
mov cs:X_mickeys,di
mov cs:Y_mickeys,si

ret
_handler ENDP
END