I've talked about this issue a number of times, and provided non-version-dependent code.

by (Login Mikrondel)
Moderator

Like this one, which (to the best of my knowledge) can be used as a drop-in replacement for InterruptX in all versions. (4.5 and 7.1 need the /L flag as usual.)

TYPE regs
AX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BX AS INTEGER
SP AS INTEGER 'Ignored
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
Flags AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE

SUB Mouse.Int (R AS regs)
STATIC Code AS STRING, M() AS INTEGER
IF LEN(Code) = 0 THEN
DIM M(0 TO 26) AS INTEGER
Code = "5589E58B76069C061EB90B00FCAD50E2FC071F9D61CD"

'* Change this to the desired interrupt number (in hex) *
Code = Code + "33"

Code = Code + "609C1E0689E58E46168B7E2283C714B90B00FD58ABE2FC1F079D5DCA02"
DEF SEG = VARSEG(M(0))
FOR I = 0 TO 51
POKE VARPTR(M(0)) + I, VAL("&H" + MID$(Code, I * 2 + 1, 2))
NEXT
END IF
DEF SEG = VARSEG(M(0))
CALL ABSOLUTE(R, VARPTR(M(0)))
DEF SEG
END SUB

Posted on Dec 11, 2009, 7:44 PM

Respond to this message   

Return to Index


Response TitleAuthor and Date
* ARE YOU SHURE ABOUT THAT TYPE definition? on Dec 12
 Why, have you found somewhere where it doesn't work? on Dec 12
  * Just wanted to make sure. Thanks, I added it to the QB64 WIKI. on Dec 12