Microsoft KB Archive/46817

= Getting High-Intensity Background Color in SCREEN 0 =

Article ID: 46817

Article Last Modified on 11/21/2006

-

APPLIES TO


 * 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
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q46817



SUMMARY
To print text with a high-intensity background, you must meet the following requirements:
 * 1) Be in SCREEN 0 (text mode)
 * 2) Operate on a machine with an EGA, VGA, or MCGA graphics adapter

To get a high-intensity background, use ROM BIOS interrupt 10 Hex, with function 10 Hex and subfunction 3 Hex, to set the third bit in the Attribute Controller's Mode Control Register. This disables blinking and enables high intensity. Once this is done, you can print characters to the screen through the BIOS, using BIOS interrupt 10 Hex with function 9 Hex. In this way, a background color that had previously been blinking is now in high intensity.

For information on controlling background color in screen modes other than SCREEN 0, query in this Knowledge Base on the word S9COLOR. This query locates an article about using foreground colors to emulate background colors.

This information applies to Microsoft QuickBasic versions 4.00, 4.00b, and 4.50 for MS-DOS; to Microsoft Basic Compiler versions 6.00 and 6.00b for MS-DOS; and to Microsoft Basic PDS versions 7.00 and 7.10 for MS-DOS.



MORE INFORMATION
For a detailed discussion of the Attribute Controller and BIOS interrupts, please refer to the following sources:
 * 1) &quot;Programmer's Guide to the EGA and VGA Cards&quot; by Richard F. Ferraro.
 * 2) &quot;Programmer's Guide to PC and PS/2 Video Systems&quot; by Richard Wilton, published by Microsoft Press (1987). See especially Pages 53-54 and 466-472.

The following program demonstrates printing with a high-intensity background color; it operates in SCREEN 0 on machines equipped with an EGA, VGA, or MCGA graphics card: ' $INCLUDE: 'QB.BI' ' For BC.EXE and QBX.EXE for Basic 7.00/7.10 use include file 'QBX.BI'

'DIM InReg as RegType, OutReg as RegType

CLS COLOR 15,13 PRINT &quot;Before the call to the interrupt&quot; PRINT &quot;CCCCCCCC&quot;

InReg.ax = &H943                  'Call BIOS interrupt to InReg.bx = &HDF                    'display characters InReg.cx = &H8 CALL Interrupt(&H10, InReg, OutReg)

LOCATE 4, 1 INPUT &quot;Press ENTER to change to high intensity...&quot;; a$

InReg.ax = &H1003                 'Call BIOS interrupt to InReg.bx = 0                       'enable high intensity CALL Interrupt(&H10, InReg, OutReg)

PRINT &quot;After the call to the interrupt&quot; PRINT &quot;CCCCCCCC&quot;

InReg.ax = &H943                  'Call interrupt to print InReg.bx = &HDF                   'characters again. Both InReg.cx = &H8                    'the BIOS-printed sets of CALL interrupt(&H10, InReg,OutReg) 'characters will have a                                   'high-intensity background. END

Additional query words: QuickBas BasicCom

Keywords: KB46817

-

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

© Microsoft Corporation. All rights reserved.