www.delorie.com/djgpp/v2faq/faq144.html | search |
| Previous | Next | Up | Top |
int86
int86
or intdos
functions to invoke a software
interrupt?
int86
family of functions in the DJGPP library should
reissue the INT instruction after the mode switch. However, some services require pointers to memory buffers. Real-mode DOS/BIOS functions can only access buffers in conventional memory, so
int86
has to move data between your program and low memory to transparently support these services. But this means it should know about all these services to perform these chores
correctly, because each service has its own layout and size of the buffer(s). While int86
supports many of these services, it doesn't support all of them. The supported functions are
listed in the library reference. See the "int86" section of the "libc.a reference". For those it doesn't support, you
will have to call the __dpmi_int
library function instead. It is also documented in the library reference, see
the "__dpmi_int" section of the "libc.a reference". __dpmi_int
requires that you set up all the data as
required by the service you are calling, including moving the data to and from low memory (see how to use buffers with DOS/BIOS services).
Note that calling int86
and intdos
can sometimes cause trouble due to size (16 bits as opposed to 32 bits) of the members in the union REGS
structure. Do
not assume that e.g. regs.x.ax
is always 16 bit! This problem and the facilities available to specify the width of the registers are all described in the library reference; see
the "int86" section of the "libc.a reference".
In particular, programs which interface with the mouse via calls to the int86
library function, should mask off the high 16 bits of the registers which report mouse position and other
values, since the high 16 bits aren't necessarily zeroed (which will wreak havoc in any program that interfaces to the mouse).
webmaster donations bookstore | delorie software privacy |
Copyright ⌐ 1998 by Eli Zaretskii | Updated Nov 1998 |
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)