How to change screen display mode using Turbo C

The ROM BIOS (Basic Input Output System) provides device control for the PC's major devices (disk, video, keyboard, serial port, printer), allowing a programmer to communicate with these devices without needing detailed knowledge of their operation. The ROM routines are accessed via the Intel 8088/86 software generated interrupts(Number). 
The ROM BIOS supports many ROM BIOS INTERRUPT(Number) ROUTINES
 ROM BIOS INTERRUPT(Number) ROUTINES
 10      Video routines
 11      Equipment Check
 12      Memory Size Determination
 13      Diskette routines
 14      Communications routines
 15      Cassette
 16      Keyboard routines
 17      Printer
 18      Cassette BASIC
 19      Bootstrap loader
 1A     Time of Day
 we can use this interrupt(Number) routins by setting register value. C language has already beed created, and resides in header file dos.h. it is a union type REGS, which has two parts.
One structure contains the eight bit registers (accessed by .h.), the other structure contains the 16 bit registers (accessed by .x.). To generate the desired interrupt, a special function call has been provided. This function accepts the interrupt number, and pointers for the Input and output register values. The following program demonstrates the use of these concepts to set the display mode to 40x25 color.
#include <dos.h>
union REGS regs;
main()
{
regs.h.ah = 0;
regs.h.al = 1;
int86( 0x10, &regs, &regs );
printf("Fourty by Twenty-Five color mode.");
}
VIDEO ROM BIOS CALLS
The ROM BIOS supports many routines for accessing the video display. The following table illustrates the use of software interrupt 0x10(16). SCREEN DISPLAY MODE FUNCTION CALL (regs.h.ah = 0)
regs.h.al Screen Mode
 0      40.25 BW 
 1      40.25 CO
 2      80.25 BW
 3      80.25 CO
 4      320.200 CO
 5      320.200 BW
 6      640.200 BW
 7      Mono-chrome
 8      160.200 16col PCjr
 9      320.200 16col PCjr
 A     640.200 4col PCjr
 D     320.200 16col EGA
 E      640.200 16col EGA
 F      640.350 mono EGA
 10    640.350 16col EGA

No comments:

Post a Comment