Setting the Border Color in EGA and VGA with CALL INTERRUPT

ID: Q61657


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
  • Microsoft QuickBASIC for MS-DOS, versions 4.0, 4.0b, 4.5
  • Microsoft BASIC Compiler for MS-DOS, versions 6.0, 6.0b
  • Microsoft BASIC Professional Development System (PDS) for MS-DOS, version 7.0


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 :
Version : MS-DOS:1.0,4.0,4.0b,4.5; :6.0,6.0b,7.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 4, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.