home *** CD-ROM | disk | FTP | other *** search
- '***************************************************************
- '* QB24.BAS *
- '* *
- '* Demonstrates Mouse Function 24... *
- '* Set Alternate Interrupt Subroutine Call Mask and Address *
- '* *
- '* Load QB.QLB into memory with QuickBASIC, type *
- '* QB /L QB.QLB *
- '***************************************************************
-
- DEFINT A-Z
-
- TYPE RegType
- ax AS INTEGER
- bx AS INTEGER
- cx AS INTEGER
- dx AS INTEGER
- bp AS INTEGER
- si AS INTEGER
- di AS INTEGER
- flags AS INTEGER
- END TYPE
-
- DECLARE SUB Interrupt (intnum%, iReg AS RegType, oReg AS RegType)
-
- DIM iReg AS RegType
- DIM oReg AS RegType
-
- DIM msub%(5)
- COMMON msub%()
-
- ' Build interrupt driven subroutine for function 24 activation
- msub%(0) = &H4B8 ' Subroutine is from this code...
- msub%(1) = &HB900 ' MOV AX,4 ; Function 4, Set
- ' ; Mouse Cursor Position
- msub%(2) = &H0 ' MOV CX,0 ; Left edge of screen
- msub%(3) = &HBA ' MOV DX,0 ; Top edge of screen
- msub%(4) = &HCD00 ' INT 33h ; Mouse Interrupt
- msub%(5) = &HCB33 ' RETF ; Return to BASIC
-
- ' Display instructions
- CLS
- PRINT "Test by holding Shift key while pressing"
- PRINT "and releasing the left mouse button."
- PRINT "Then press Enter."
-
- ' Mouse Reset and Status
- iReg.ax = 0
- Interrupt &H33, iReg, oReg
-
- ' Show Cursor
- iReg.ax = 1
- Interrupt &H33, iReg, oReg
-
- ' Set Alternate Interrupt Subroutine Call Mask and Address
- iReg.ax = 24
- iReg.cx = 36 ' Left button released and Shift key pressed
- iReg.dx = VARPTR(msub%(0))
- Interrupt &H33, iReg, oReg
-
- ' Wait until any key is pressed
- DO
- LOOP WHILE INKEY$ = ""
-
- ' Deactivate Function 24
- iReg.ax = 24
- iReg.cx = 32
- Interrupt &H33, iReg, oReg
-
- ' Reset mouse
- iReg.ax = 0
- Interrupt &H33, iReg, oReg
-
- END
-
-