Microsoft KB Archive/57385

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 13:14, 21 July 2020 by X010 (talk | contribs) (Text replacement - "&" to "&")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base


INT86OLD & INT86XOLD Not in QB 4.50 or Basic 7.00 Help, Manual

Article ID: 57385

Article Last Modified on 8/16/2005



APPLIES TO

  • Microsoft BASIC Professional Development System 7.0
  • Microsoft QuickBasic 4.5 for MS-DOS



This article was previously published under Q57385

SUMMARY

The "Microsoft Basic 7.0: Basic Language Reference" manual fails to document the INT86OLD and INT86XOLD routines.

Also, CALL INT86OLD and CALL INT86XOLD are not documented in the online Help systems for either QB.EXE in QuickBasic 4.50 or for QBX.EXE, which comes with Microsoft Basic Professional Development System (PDS) Version 7.00.

A complete description of INT86OLD and INT86XOLD are provided below for owners of Basic PDS 7.00, and for owners of QuickBasic 4.50 who do not own a copy of the "Microsoft QuickBasic 4.5: Basic Language Reference."

MORE INFORMATION

Note that CALL INT86OLD and CALL INT86XOLD are documented in the "Microsoft QuickBasic 4.5: Basic Language Reference" manual for QuickBasic 4.50. The following description of INT86OLD and INT86XOLD is taken from Page 72 of that manual [additional comments are in brackets ([])]:

CALL INT86OLD Statements

ACTION: Allows programs to perform DOS system calls

SYNTAX: CALL INT86OLD (intno, inarray(), outarray()) CALL INT86XOLD (intno, inarray(), outarray())

REMARKS: The CALL INTERRUPT statement provides an easier way to make DOS system calls. See the entry for CALL INTERRUPT for more information. The following list describes the arguments to INT86OLD and INT86XOLD:

Argument    Description
-----------------------
intno       The DOS interrupt to perform. It is an integer between 0
            and 255. See your DOS documentation for the interrupt
            numbers.

inarray()   An integer array specifying the register values when the
            interrupt is performed.

            INT86OLD uses an eight-element array, while INT86XOLD
            uses a ten-element array. Table R.1 lists the array
            elements and the corresponding registers.

outarray()  Contains the post-interrupt register values. It has the
            same structure as inarray().
                    

If an error occurs, intno = -1 and values in outarray are unchanged. Errors are caused by in_no not being in the range 0 - 255.

Table R.1 INT86OLD and INT86XOLD Register Values
------------------------------------------------
Array Element         Register
------------------------------------------------
inarray(x)              AX
inarray(x+1)            BX
inarray(x+2)            CX
inarray(x+3)            DX
inarray(x+4)            BP
inarray(x+5)            SI
inarray(x+6)            DI
inarray(x+7)            FLAGS
inarray(x+8)*           DS
inarray(x+9)*           ES
------------------------------------------------
*  These array elements are used only by INT86XOLD. To use the
   current run-time values of DS and ES, assign the value -1 to array
   elements 8 and 9.
                

The INT86OLD and INT86XOLD routines alter all registers except BP and DS.

INT86OLD and INT86XOLD provide compatibility with older [QuickBasic 2.00, 2.01, or 3.00] programs using INT86 and INT86X. Like the INT86 and INT86X routines, INT86OLD and INT86XOLD are distributed in a Quick library [QB.QLB for QB.EXE and QBX.QLB for QBX. EXE] and in a conventional library [QB.LIB for QuickBasic 4.x and QBX.LIB for Basic PDS 7.00] on the distribution disks. The disks also contain a header file [QB.BI for QuickBasic 4.x or QBX.BI for Basic PDS 7.00] for use with the procedures. See the disk-contents list for specific information.

Note that INT86OLD and INT86XOLD do not require the use of VARPTR. Also, the register values are stored in the arrays beginning with the first array element.

EXAMPLE

'This example uses INT86OLD to open a file and place some text in it.

' Note: To use CALL INTERRUPT, you must load the Quick library QB.LIB
'       with QuickBasic. The program also uses the QB.BI header file.

' Include header file for INT86OLD, etc.
$INCLUDE:'QB.BI'

DIM INARY%(7),OUTARY%(7)          'Define input and output
                                  'arrays for INT86.
'
' Define register-array indices to
' make program easier to understand.
CONST AX=0, BX=1, CX=2, DX=3, BP=4, SI=5, DI=6, FL=7
'
INARY%(AX) = &H3C00               'DOS function to create a file.
INARY%(CX) = 0                    'DOS attribute for created file.
TEMP$="MYNAME.TXT"+CHR$(0)
INARY%(DX) = SADD(TEMP$)
                                  'Pointer to file-name string
                                  'with zero byte termination.

CALL INT86OLD(&H21,INARY%(),OUTARY%())
                                  'Perform the creation.
'
INARY%(BX) = OUTARY%(AX)         'Move created file handle for write.
INARY%(AX) = &H4000               'DOS function to write to file.
TEXT$ = "hello, world"+CHR$(13)+CHR$(10)
                                  'Define text to write to file.
INARY%(CX) = LEN(TEXT$)           'Get length of text string.
INARY%(DX) = SADD(TEXT$)          'Get address of text string.
CALL INT86OLD(&H21,INARY%(),OUTARY%())
                                  'Perform the write.
'
INARY%(AX) = &H3E00               'DOS function to close a file.
CALL INT86OLD(&H21,INARY%(),OUTARY%())
                                  'Perform the close.
                


Additional query words: QuickBas BasicCom

Keywords: KB57385