Microsoft KB Archive/67585

Setting Number of Lines with ANSI.SYS ID Number: Q67585

4.00 4.01 MS-DOS buglist4.00 buglist4.01

Summary:

ANSI.SYS does not handle resolution modes greater than 25 lines. If a VGA is set to mode 12 and more than 25 lines of data are displayed, the 25th is repeatedly overwritten. It is expected behavior that the MS-DOS 4.01 doesn’t recognize a change in the number of character rows if the change is made by any other means than MODE CO80,nn, or the Int 21h/Function 44h API described below.

ANSI.SYS should recognize a change to the number of character rows displayed when the change is made by standard ROM BIOS calls from third-party applications.

Microsoft has confirmed this current limitation to be a problem with the MS-DOS 4.01 ANSI.SYS. We are researching this problem and will post new information here as it becomes available.

More Information:

ANSI.SYS keeps a table of video configuration information in its internal data area. Since it does not detect a video-mode change that was issued directly to the video card or via a ROM BIOS call, the internal table retains 25 as the number of text lines. The ROM BIOS, however, is aware of the number of lines on the screen. It is this discontinuity that causes the strange results observed.

The MS-DOS 4.00 ANSI.SYS driver requires a generic IOCtl to get and set the display information (interrupt 21h, function 44h, sub-function 0Ch, major code 03h, minor codes 7fh and 5fh). These minor codes are a new addition to MS-DOS 4.00. The MODE command uses this method to change the number of video text lines when you issue a MODE command such as:

MODE CO80,43

You can call the MS-DOS int 21h function from assembly by setting the registers as follows:

AH = 44h ;IOCtl AL = 0Ch ;Character device generic CH = 03h ;Major code


 * Choose one of the following minor codes: CL = 7Fh ;Get configuration CL = 5Fh ;Set configuration

BX = Handle of opened CON device DS:DX = segment:offset of parameter block.

The structure of the parameter block for the Get/Set Display Information IOCtl is as follows:

It is best to get the parameter block, modify it, and then set it. This will allow the changing of the fields that need to be altered while leaving the other parameters the same.

This IOCtl function is documented on pages 205-207 in the “Microsoft MS-DOS Programmer’s Reference” version 4.0 (Part #04943). It is also documented in Ray Duncan’s “Advanced MS-DOS Programming,” 2nd Edition. Ray Duncan’s book contains a more detailed description of the data structure used by this function call.