To use one of these funtions, first place the function number in AH, then set the other input registers, then call the function with INT 10h. Registers not used by the function as inputs or outputs are not affected.
Note: The text functions work in all modes, including graphics modes.
Sets the video mode. This function will clear the screen unless bit 7 of the AL register is set.
AH = 00h
AL = Video Mode (add 128 to not clear the screen). This is an very incomplete list of modes; see another interrupt reference for full details of all modes supported.
01h: 40x25 Text, 16 colors, 8 pages
03h: 80x25 Text, 16 colors, 8 pages
13h: 320x200 Graphics, 256 colors, 1 page
(None)
Sets the starting and ending lines of the screen cursor, and can also be used to make the cursor invisible. In some modes, the characters are not exactly 8 lines high in these cases the graphics hardware will adapt the input values to the current character size.
AH = 01h
CH = Starting line of cursor (0-7). Add 20h to make the cursor invisible.
CL = Ending line of cursor (0-7).
(None)
Moves the cursor to the specified position on the screen. The video hardware maintains a separate cursor for each display page, and the cursor will move only if the page number given in BH is the current display page. Giving a position that is off the screen will cause the cursor to disappear from the screen.
AH = 02h
BH = Display page (valid only in text modes--use 00h for graphics modes).
DH = Row (00h is top row).
DL = Column (00h is leftmost column).
(None)
Sets the display page which will appear on the screen.
AH = 05h
AL = Display page (the range of valid values depends on the current video mode--see Function 00h)
(None)
Scrolls part or all of the current display page up by one or more text lines. This function can also be used to clear part or all of the screen.
AH = 06h
AL = Number of lines to be scrolled up (AL = 00h will clear the window).
BH = Color attribute for blank lines. In text mode, this corresponds to the attribute byte. In VGA graphics modes, this is the color number to which all the pixels in the blank lines will be set.
CH = Top row of window to be scrolled up.
CL = Leftmost column of window.
DH = Bottom row of window.
DL = Rightmost column of window.
(None)
AH = 07h
AL = Number of lines to be scrolled down (AL = 00h will clear the window).
BH, CH, CL, DH, DL : Same as Function 06h.
(None)
AH = 08h
BH = Display page.
AL = ASCII code of character. If the current video mode is a graphics mode and no match is found, 00h is returned.
AH = Color attribute.
Writes the specified character with the specified color attribute at the current cursor position in the specified display page. The cursor is NOT moved to the next screen position. Special control codes are not recognized, and are printed as normal ASCII characters (e.g., writing a carriage return will not cause the cursor to move to the beginning of the line).
AH = 09h
AL = ASCII code.
CX = Repeat factor. The character will be written this many times. In graphics mode, all the characters must fit on the same screen line.
BH = Display page.
BL = Color attribute. In text mode, this corresponds to the attribute byte. In graphics mode, this is the foreground color (the background color will be 0). In graphics mode, if bit 7 is set, the character will be XORed with the current bitmap.
(None)
This function is identical to Function 09h except that in text modes, the attribute byte currently in video memory is not modified (BL is ignored). In graphics modes, this function is exactly identical to Function 09h. See the comments for Function 09h.
AH = 0Ah
AL, CX, BH, BL : Same as Function 09h
(None)
Sets the color number of the specified pixel in graphics mode. Valid in all graphics modes.
AH = 0Ch
BH = Display page.
DX = Screen line (0 is top).
CX = Screen column (0 is leftmost).
AL = Color number.
(None)
Returns the color number of the specified pixel in graphics mode. Valid in all graphics modes.
AH = 0Dh
BH = Display page.
DX = Screen line (0 is top).
CX = Screen column (0 is leftmost).
AL = Color number.
Writes the specified character to the current cursor position in the current display page. In text modes, the attribute byte is not modified. The cursor is moved to the next screen position, and the screen is scrolled up if necessary. Special ASCII characters, like carriage return and backspace, are interpreted as control codes and will modify the cursor position accordingly.
AH = 0Eh
AL = ASCII code.
BL = Foreground color (valid only in graphics modes).
(None)
Color in VGA modes is quite complicated because it is based on a palette of colors. There are 256 DAC (Digital-to-Analog Converter) registers. Each of these 18-bit registers contains an RGB (Red, Green, Blue) color value. These registers define the basic color palette used in 256-color modes. register. Each palette register corresponds to one color number in video memory. For example, if the bitmap contains color number 17 for a certain pixel, then DAC register #17 determines what color will be generated for the pixel.
It is possible to set the DAC registers by using either Interrupt 10h functions (listed below) or by directly accessing the VGA card using port I/O. See Example 11-1 for code that sets the palette using port I/O. For more information on VGA graphics, see Section 11.2.
Sets the color of the border around the screen.
AX = 1001h
BH = DAC register number (0-255).
(None)
Sets the RGB (Red, Green, Blue) values for one of the DAC (Digital-to-Analog Converter) registers.
AX = 1010h
BX = DAC register number (0-255).
DH = Red value (0-63).
CH = Green value (0-63).
CL = Blue value (0-63).
(None)