Microsoft KB Archive/61657

= Setting the Border Color in EGA and VGA with CALL INTERRUPT =

Article ID: 61657

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft Visual Basic for MS-DOS
 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q61657



SUMMARY
In EGA and VGA SCREEN modes, the color of the border cannot be set using the COLOR statement. However, the ROM BIOS Interrupt 10h, function 10h, subfunction 01 can be used to control the color of the screen border.



MORE INFORMATION
The following program calls ROM BIOS Interrupt 10h (16 decimal), with function 10h and subfunction 1, to set the border color. The color value is put in register BH. To use this program, do the following:

Code Example
' 1. From the File menu, choose New Project. ' 2. Copy the code example to the Code window. ' 3. Press F5 to run the program.

' To run this program in the VBDOS.EXE environment, you must invoke ' the VBDOS.EXE environment with the /L switch to load the default ' Quick library: ' VBDOS.EXE /L for Visual Basic for MS-DOS 1.0

' To run this program in the QB.EXE or QBX.EXE environment, you ' must invoke the QB.EXE or QBX.EXE environment with the /L switch ' to load the default Quick library: ' '     QB /L QB.QLB       (for QuickBasic for MS-DOS, 4.0, 4.0b, or '                          4.5, and Basic Compiler for MS-DOS 6.0 and 6.0b) '  or '      QBX /L QBX.QLB     (for Basic PDS for MS-DOS 7.0) ' '  (The /L option above loads the QB.QLB or QBX.QLB Quick library, '   which contains the CALL INTERRUPT routine.) ' ' If you are compiling and linking outside the QB.EXE (or QBX.EXE) ' environment, QB.LIB must be linked in. For QBX.EXE, you must link ' in QBX.LIB.

' Use the following include file for Visual Basic for MS-DOS 1.0: REM $INCLUDE: 'VBDOS.BI' ' Use the following include file for QuickBasic for MS-DOS: ' $INCLUDE: 'qb.bi' ' Use the following include file for Basic PDS for MS-DOS 7.0: ' $INCLUDE: 'qbx.bi'

DIM inregs AS RegType, outregs AS RegType SCREEN 12  ' Any EGA or VGA SCREEN mode can be used here. inregs.ax = &H1001  ' Function 10h and subfunction 1 are put in                        ' AX. inregs.bx = &H200   ' 2 representing green is put in BH. CALL Interrupt(&H10, inregs, outregs)  ' A green border is                                           ' produced.

Additional query words: VBmsdos QuickBas BasicCom 1.00 4.00 4.00b 4.50 6.00 6.00b 7.00

Keywords: KB61657

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.