home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / MSMOUSE1.ZIP / BAS.ZIP / QB24.BAS < prev    next >
Encoding:
BASIC Source File  |  1989-02-03  |  2.3 KB  |  76 lines

  1.   '***************************************************************
  2.   '*  QB24.BAS                                                   *
  3.   '*                                                             *
  4.   '*  Demonstrates Mouse Function 24...                          *
  5.   '*  Set Alternate Interrupt Subroutine Call Mask and Address   *
  6.   '*                                                             *
  7.   '*  Load QB.QLB into memory with QuickBASIC, type              *
  8.   '*  QB /L QB.QLB                                               *
  9.   '***************************************************************
  10.   
  11.     DEFINT A-Z
  12.   
  13.     TYPE RegType
  14.         ax    AS INTEGER
  15.         bx    AS INTEGER
  16.         cx    AS INTEGER
  17.         dx    AS INTEGER
  18.         bp    AS INTEGER
  19.         si    AS INTEGER
  20.         di    AS INTEGER
  21.         flags AS INTEGER
  22.     END TYPE
  23.   
  24.     DECLARE SUB Interrupt (intnum%, iReg AS RegType, oReg AS RegType)
  25.   
  26.     DIM iReg AS RegType
  27.     DIM oReg AS RegType
  28.   
  29.     DIM msub%(5)
  30.     COMMON msub%()
  31.   
  32.   ' Build interrupt driven subroutine for function 24 activation
  33.     msub%(0) = &H4B8            ' Subroutine is from this code...
  34.     msub%(1) = &HB900           '   MOV AX,4  ; Function 4, Set
  35.                                 '             ; Mouse Cursor Position
  36.     msub%(2) = &H0              '   MOV CX,0  ; Left edge of screen
  37.     msub%(3) = &HBA             '   MOV DX,0  ; Top edge of screen
  38.     msub%(4) = &HCD00           '   INT 33h   ; Mouse Interrupt
  39.     msub%(5) = &HCB33           '   RETF      ; Return to BASIC
  40.   
  41.   ' Display instructions
  42.     CLS
  43.     PRINT "Test by holding Shift key while pressing"
  44.     PRINT "and releasing the left mouse button."
  45.     PRINT "Then press Enter."
  46.  
  47.   ' Mouse Reset and Status
  48.     iReg.ax = 0
  49.     Interrupt &H33, iReg, oReg
  50.   
  51.   ' Show Cursor
  52.     iReg.ax = 1
  53.     Interrupt &H33, iReg, oReg
  54.   
  55.   ' Set Alternate Interrupt Subroutine Call Mask and Address
  56.     iReg.ax = 24
  57.     iReg.cx = 36                ' Left button released and Shift key pressed
  58.     iReg.dx = VARPTR(msub%(0))
  59.     Interrupt &H33, iReg, oReg
  60.   
  61.   ' Wait until any key is pressed
  62.     DO
  63.     LOOP WHILE INKEY$ = ""
  64.   
  65.   ' Deactivate Function 24
  66.     iReg.ax = 24
  67.     iReg.cx = 32
  68.     Interrupt &H33, iReg, oReg
  69.  
  70.   ' Reset mouse
  71.     iReg.ax = 0
  72.     Interrupt &H33, iReg, oReg
  73.   
  74.     END
  75.   
  76.