home *** CD-ROM | disk | FTP | other *** search
- ;******************************************************************
- ;* M20SUB.ASM *
- ;* *
- ;* Macro Assembler subroutine for C/QuickC program PENCIL.C *
- ;* *
- ;* _NewMouseHardwareSub: *
- ;* Description: Passes the mouse variables to the C routine *
- ;* when a mouse interrupt occurs *
- ;* *
- ;* This code is to be linked with PENCIL.C *
- ;* Example: *
- ;* masm /Ml m20sub; *
- ;* cl /AM pencil.c m20sub.obj -link mouse *
- ;******************************************************************
-
- EXTRN _ButtonState:WORD ; Mouse button state
- EXTRN _HorizCursCoord:WORD ; Current horizontal cursor position
- EXTRN _VertCursCoord:WORD ; Current vertical cursor position
- EXTRN _MouseConditionBits:WORD ; Condition that resulted
- ; in calling this routine.
-
- code SEGMENT para public 'code'
- assume cs:code
- public _NewMouseHardwareSub
-
- _NewMouseHardwareSub PROC far ; Far procedure
- push DS ; Save current data segment
- push AX ; Save condition mask
- mov AX,SEG _ButtonState ; Load data segment
- mov DS,AX
- pop AX ; Restore condition mask
- mov _MouseConditionBits,ax ; Pass condition to C routine
- mov _ButtonState,BX ; Pass button state to C routine
- mov _HorizCursCoord,CX ; Pass cursor coordinates to C routine
- mov _VertCursCoord,DX
- pop DS ; Restore data segment
- RET ; Far return
- _NewMouseHardwareSub ENDP
-
- code ENDS
- end ; End of NewMouseHardwareSub
-