Int 10H [MDA] [CGA] [PCjr] [EGA] [MCGA] [VGA] Function 09H Write character and attribute at cursor

Writes an ASCII character and its attribute to the display at the current cursor position.

Call with:

AH = 09H

AL = character

BH = page

BL = attribute (text modes) or color (graphics modes)

CX = count of characters to write (replication factor)

Returns:

Nothing

Notes:

In graphics modes, the replication factor in CX produces a valid result only for the current row. If more characters are written than there are remaining columns in the current row, the result is unpredictable.

All values of AL result in some sort of display; control characters, including bell, backspace, carriage return, and line feed, are not recognized as special characters and do not affect the cursor position.

After a character is written, the cursor must be moved explicitly with Int 10H Function 02H to the next position.

To write a character without changing the attribute at the current cursor position, use Int 10H Function 0AH.

If this function is used to write characters in graphics mode and bit 7 of BL is set (1), the character will be exclusive-OR'd (XOR) with the current display contents. This feature can be used to write characters and then "erase" them.

For the CGA and PCjr in graphics modes 04H—06H, the bit patterns for character codes 80H—FFH are obtained from a table whose address is stored in the vector for Int 1FH. On the PCjr, the address of the table for character codes 00H—7FH is stored in the vector for Int 44H. Alternative character sets may be installed by loading them into memory and updating this vector.

For the EGA, MCGA, and VGA in graphics modes, the address of the character definition table is stored in the vector for Int 43H. See Int 10H Function 11H.