Copy Link
Add to Bookmark
Report

QuickBasicNews Issue 1: INTERRUPTS

eZine's profile picture
Published in 
QuickBasicNews
 · 4 years ago

 
…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
∫ INTERRUPTS ∫
»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
A QuickBasic specific article

QuickBasic includes a library called QB.QLB that allows the use
of three routines. These are INTERRUPT, INT86OLD, and ABSOLUTE.
These routines provide for the use of software-interrupts.

There are several types of interrupts, hardware interrupts and Software
interrupts. But just what is an interrupt? An interrupt is a signal
to the Central Processing Unit (CPU) to stop what ever it is doing,
and process the interrupt. Information provided by processing an
interrupt can return valuable information about some event ( such as
the status of a mouse button ). Interrupts can return information
at incredible speed. In a hardware interrupt, the interrupt instruction
comes from within the computer. With a software interrupt, the
computer program starts the interrupt. If it weren't for the use of
interrupts the CPU would constantly be checking for external events.
An external event would be something like: Was the left mouse
button pressed ?, or was the mouse moved ?, or was the joystick
fire button pressed ? etc.... With interrupts, the CPU can keep
doing something else, and respond to an external event when it occurs.

If you are familiar with QuickBasic and are ready to learn how to
use interrupts, it would be helpful if you had a list of interrupts
and their functions. Because this list is extremely large we suggest
you look for the files containing these interrupt lists on your
local BBS systems. Look for the file names

InterxxA.zip ø
InterxxB.zip ≥_______ where xx is the version number of the current
InterxxC.zip ≥ release ( 38 being the latest I am aware of )
InterxxD.zip Ÿ

I should warn you that if you intend to print out these lists you
should have lots of time and printer paper ( over 1000 sheets of paper ).
The list is put out by Ralph Brown. The above MSDOS interrupt list
contains over 5900 functions available through interrupt calls on IBM
PCs and Compatibles. Although these lists are readily available from
many local BBS systems, you may want to consider the book by Ralph
Brown & Jim Kyle available at many bookstores. The electronic listings
mentioned above are a listing (in numerical order) of the interrupt
numbers, and does not contain an index as the book version does. Neither
the book version, nor the electronic listings were intended as a
tutorial on interrupts. The listings primarily serve as a reference
source to the different interrupt numbers and their functions. The
Book is available at major bookstores under the name:

PC Interrupts:
A Programmer's Reference to Bios, DOS, and Third-
Party Calls
(Second Edition)
Ralph Brown and Jim Kyle
1210 Pages
Addison - Wesley
ISBN 0-201-62485-0
$39.95

Because the interrupt lists are so long, we cannot cover all of
the interrupts in this publication. Next month we will take a look
at some interrupt numbers and their functions and we will show how
to incorporate an interrupt instruction into your programming
code. Once you have a basic understanding of how to use interrupts
you can go through an interrupt list and find the ones you will need.

Call Interrupt - is a statement in QuickBasic that allows BASIC
programs to perform DOS system calls. The
format is as follows:

CALL Interrupt ( num, inregs, outregs )

* where num has a value between 0 and 255, which
is the DOS interrupt number. Thus there is a
possibility of 256 interrupts.

* where inregs contains the register values before
the interrupt is performed

* where outregs contains the register values after
the interrupt is called

( registers are special places in memory where data
is temporarily stored )

Now, as stated above there are a possibility of 256 interrupts,
0 through 255. Each interrupt can have a number of functions. For
instance in next month's column one of the things we will be
discussing is how to obtain information about the mouse through the
use of interrupts. Interrupt 33h ( the h stands for hexadecimal )
provides information about the mouse. Function 3h of interrupt
33h returns information about the position of the mouse.
Because there are numerous functions that can return information
about each interrupt, there are literally thousands of functions
available.

Obviously with so many possibilities it becomes quite apparent
that we could not begin to cover them all. Next month we will take a look
at using interrupt 33h to control and return information about the
mouse. Included will be sample code that will be easy to follow.

Interrupt 33h translates into interrupt 51 in decimal. If you
don't understand hexadecimal representations, don't worry about
it. We will explain it next time. It's not really neccesary
to know since the (h) lets QuickBasic know you mean hexadecimal,
but we will briefly cover it anyway for those that are interested.
Excuse me now, I think I am receiving an INTERRUPT from the wife !

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT