---------------------- CodeFAQ Part 5 of 11 ---------------------
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
DATA 6C,08,8B,44,0E,25,D5,0F,50,8B
DATA 04,8B,5C,02,8B,4C,04,8B,54,06
DATA 8B,7C,0C,FF,74,0A,81,7C,12,FF
DATA FF,74,03,8E,44,12,81,7C,10,FF
DATA FF,74,03,8E,5C,10,5E,9D,CD,00
DATA 55,8B,EC,9C,83,C5,0E,F6,46,FE
DATA 02,74,02,45,45,1E,56,8E,5E,FC
DATA 8B,76,08,89,04,89,5C,02,89,4C
DATA 04,89,54,06,8F,44,0A,89,7C,0C
DATA 8F,44,10,8C,44,12,8F,44,0E,8F
DATA 44,08,F6,46,FE,02,74,02,44,44
DATA 9D,5F,5E,07,1F,58,5D,CA,08,00
'---------------------------------------------------------------
' Example: get current video mode
'---------------------------------------------------------------
DIM r AS RegTypeX
r.ax = &HF00
InterruptX &H10, r, r
VideoMode = (r.ax AND &HFF)
PRINT "Video mode is "; VideoMode
END
----------- CodeFAQ ends Part 5 of 11 ---------------------------
Robert (Bob) Kohl Rio Rancho, New Mexico
Home Page: http://www.geocities.com/SiliconValley/Way/7854
http://members.tripod.com/~Bob_Kohl/index.html
Internet: bobakohl@abq.com bobakohl1@juno.com barbarianh@aol.com
--- Blue Wave/DOS v2.30
(1:301/45)
---------------
* Origin: * Binary illusions BBS * Albuquerque, NM * 505.897.8282 *
|