'>>> Page 5 of CODE0398.FAQ begins here.
Once you have the appropriate values in the registers, you are
ready to call the INTERRUPT.
CALL INTERRUPT(IntNumber, InReg, OutReg)
IntNumber is the number of the INTERRUPT you want to call. For
example, 10h (10, base-16 or HEX) is the screen INTERRUPT, so
you'd call it like this:
CALL INTERRUPT(&H10, InReg, OutReg)
Any values that the INTERRUPT is supposed to return will be
stored in the OutReg, and can be checked like you would any
other variable:
IF OutReg.Bx = 10 THEN [...]
A note: QB also offers the CALL INTERRUPTX function, which
does the exact same thing as CALL INTERRUPT, but it allows you
to use two extra registers, DS and ES. Everything is exactly
the same as CALL INTERRUPT except that you add an "X" on the
end.
So, this is all great you say, but how do I figure out which
INTERRUPT will do what? Good question. You can't, on your
own. It's a severe understatement to say that poking around
with INTERRUPTs is pretty dangerous if you don't know what
you're tapping into. You're going to need to keep your eyes
open for a list of INTERRUPTs, and there are a lot of them --
INTs, that is. The best list out there is Ralf Brown's
Interrupt List, which should be on any program-oriented BBS in
your area. Check out the No-Code FAQ for more information on
where to find it (or do a web search for it).
5) CAN I USE INTERRUPTS WITH QBASIC?
Thanks to Hans Lunsing, yes! This routine uses QBasic's CALL
ABSOLUTE feature to run the appropriate machine code so that if
you're stuck with QBasic, you too can enjoy the power of
INTERRUPTs:
[begin]
' InterruptX
' Interrupt procedure for QBASIC
' By Hans Lunsing
' Edited to fit FidoNet QB Code FAQ by Dave Shea
' --------------------------------------------------------------
DEFINT A-Z
' Register type for use with InterruptX
TYPE RegTypeX
Ax AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
Flags AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE
CONST FALSE = 0, TRUE = NOT FALSE
DECLARE SUB InterruptX (IntNo%, Inreg AS RegTypeX, OutReg AS_
RegTypeX)
'---------------------------------------------------------------
' The machine code of the interrupt procedure for InterruptX
'---------------------------------------------------------------
InterruptXASM:
' Number of bytes
DATA 190
' Hexadecimal representation of machine code
DATA 55,8B,EC,8B,5E,0C,8B,17,0A,F6
DATA 74,07,C7,07,FF,FF,E9,A7,00,8B
DATA 5E,06,8B,1F,2E,88,97,77,00,32
DATA C0,80,FA,25,74,05,80,FA,26,75
DATA 02,0C,02,50,1E,06,56,57,9C,8B
DATA 76,0A,80,FA,20,7C,05,80,FA,30
DATA 7C,0A,81,7C,08,FF,FF,74,03,8B
'>>> Page 5 of CODE0398.FAQ ends here. Continued on next page.
___
* SLMR 2.0 * "You have no choice; you have to decide." -- Bill Miller
--- Maximus/2 3.01
---------------
* Origin: The I.O. Board - 4GB -XX- V34+ (1:2255/10)
|