Article ID: 120565
Article Last Modified on 5/24/2004
===========================================================================
Format of BIOS Data Segment at segment 40h:
{items in curly braces not documented by IBM}
Offset Size Description
. . .
49h BYTE Video current mode
4Ah WORD Video columns on screen
4Ch WORD Video page (regen buffer) size in bytes
4Eh WORD Video current page start address in regen buffer
50h 16 BYTEs Video cursor position (col, row) for eight pages,
0 based
60h WORD Video cursor type, 6845 compatible, hi=startline,
lo=endline
62h BYTE Video current page number
63h WORD Video CRT controller base address: color=03D4h,
mono=03B4h
65h BYTE Video current setting of mode select register
03D8h/03B8h
66h BYTE Video current setting of CGA palette register 03D9h
===========================================================================
By reading at [CB_High_Linear + 449h], for example, you can determine the
screen mode active in the MS-DOS session. If it is 7, it is text
mode on an MDA adapter, and the text screen buffer is at [CB_High_Linear +
0B000h]. Otherwise, if it is a text video mode number, a color text
mode is in use in the MS-DOS session, and the text screen buffer is at
[CB_High_Linear + 0B800h].
On CGA (25 lines, 40 columns), the buffer size will be 0800h (2048d)
On CGA (25 lines, 80 columns), the buffer size will be 1000h (4096d)
On EGA (43 lines, 80 columns), the buffer size will be 1BE0h (7136d)
On VGA (50 lines, 80 columns), the buffer size will be 2040h (8256d)
Buffer size Number of columns Skip Attribs Result ------------------------------------------------------- 2048 / 40 / 2 25.6 4096 / 80 / 2 25.6 7136 / 80 / 2 44.6 8256 / 80 / 2 51.6NOTE: the results are not exact. Therefore, if the regenerate buffer is greater than 4096 bytes or if the number of screen columns is not equal to 25, the result must be decremented by 1 to get the real number of screen lines.
Additional query words: 3.10 VxD VDD DISPLAY
Keywords: KB120565