Format
INT86(number1,AX,BX,CX,DX,DI,SI,BP,DS,ES)
Description
This statement is used to call a DOS, BIOS, or custom-written Interrupt.
Number1 must be a constant, and should identify the number of the interrupt
to be called. The fields following number1 represent the CPU registers.
For example, ASIC will move the value from the ASIC variable "AX" to the
CPU register "AX" prior to performing the interrupt call. After the call,
ASIC will move the value from the CPU register "AX" to the ASIC variable
"AX". Your ASIC program can then use this "AX" variable just like any
other integer variable in the rest of the program. Each of the registers
listed (AX,BX,CX,DX,DI,SI,BP,DS,ES) must be included on the INT86 statement
in the same order as shown in the Format statement above. The exception to
this rule, is that you can substitute "NA" for any register you do not need
for the call. The BP register may be used to pass values to the INT86
call, however, unlike all of the other registers, ASIC does not return the
value of the BP register following the INT86 call.
Example 1
INT86(5,NA,NA,NA,NA,NA,NA,NA,NA,NA)
The above example shows the code to perform a screen print to the printer.
This example will call INT 5 (BIOS Print Screen Interrupt), pass no
parameters to the call, and receive no return values from the call.
Example 2
AX=&hex3600
DX=0
INT86(&hex21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
PRINT "Default Drive has:"
PRINT
PRINT "Sectors/Cluster";
PRINT AX
PRINT "Available Cluster Count";
PRINT BX
PRINT "Bytes/Sector";
PRINT CX
PRINT "Total Clusters";
PRINT DX
This example show a more complex call to DOS to find out free disk space
information for the current drive. DOS Interrupt 21 (hex) function 36
(hex) is used to retrieve this information. The AX register is used to
pass the function number. The DX register is used to select the disk drive
(0=the default disk drive). Note that the BX and CX registers were
included on the call. No parameters are being passed to the call in these
registers, however, we'll be receiving information back from DOS in them,
so they need to be on the INT86 statement. Since the SI,DI,BP,DS, and ES
registers are not needed by the call, they have been substituted with "NA"
which you can think of as meaning "Not Applicable" to this call. After the
call, the example program will display information about the default disk
drive.
Comments
This statement is intended for advanced programmers. To use it properly,
you must have some knowledge of assembler language, or (at least) the CPU
registers in the IBM PC. You also need a DOS or BIOS reference manual to
identify which registers to pass to each interrupt, and to identify the
values to place in those registers.
One register was required for ASIC housekeeping after the INT86 call. This
is why the BP register is unavailable to receive return values from calls.
The BP register was chosen, because none of the DOS or BIOS Interrupts use
this register to return values. If you write your own interrupts and want
to call them from an ASIC program, remember that you can pass the BP
register to the interrupt, but the ASIC "BP" variable will not be updated
following the interrupt.
If a register is not needed for the call, specify "NA" instead of the
register name. ASIC does not generate any code for "NA" registers, and
this will reduce the size of your program.
See Also
-
CODE
- GETREGS
- SETREGS
- PEEK
- POKE