INF: Using BIOS Function 10h to Get 43-Line Mode in C 5.1

ID Number: Q75215

5.10

MS-DOS

Summary:

The Microsoft C Compiler version 5.1 README.DOC file states that "the

graphics library now functions correctly in 43-line mode on an EGA,

and in 30-line, 43-line, 50-line, and 60-line modes on a VGA."

This information is correct; however, the C 5.1 run-time library does

not contain a function that will change modes. The same is also true

for the Microsoft QuickC Compiler versions 1.0 and 1.01. A BIOS

function can be used to make the change.

More Information:

The following program illustrates the use of Interrupt 10h, function

11h, subfunction 23h (load ROM BIOS 8 x 8 graphics character set) to

set an EGA system into 43-line mode. The interrupt call must be made

BEFORE the call to _setvideomode(). If the routine is called after

_setvideomode(), the text height is changed; however, the program will

use only the upper 25 lines of the screen.

Font selection in text mode is controlled through Interrupt 10h,

function 11h, subfunctions 0h - 14h; font selection in graphics mode

is controlled by subfunctions 20h - 24h.

Sample Code

-----------

/* Compile options needed: none

*/

#include <graph.h>

#include <conio.h>

#include <dos.h>

union REGS inregs, outregs;

struct SREGS segregs;

int result;

void main( )

{

inregs.h.ah = 0x11; /* Load Function # into AH register */

inregs.h.al = 0x23; /* Load SubFunc # into AL register */

inregs.h.bl = 0x03; /* Load 43-line constant into BL */

/* For 50-line mode, use */

/* inregs.h.bl=0x00; */

/* inregs.h.dl=0x32; */

int86x( 0x10, &inregs, &outregs, &segregs );

_setvideomode( _ERESCOLOR ); /* 640x350 EGA graphics mode */

/* For VGA lines, change to: */

/* _setvideomode( _VRES16COLOR );*/

_settextposition( 30, 30 );

_outtext( "This should be tiny text!\n" );

while( !kbhit() );

_setvideomode( _DEFAULTMODE );

}

Additional reference words: 1.00 5.10 run-time apl5.10