INT 10H 01H: Set Cursor Shape & Size
Compatibility: All
Expects: AH 01H
CH start scan line of character matrix (0-1fH; 20H=no cursor)
CL end scan line of character matrix (0-1fH)
──────────────────────────────────────────────────────────────────
Returns: (none)
──────────────────────────────────────────────────────────────────
Info: This sets the size of the hardware (blinking) cursor and its
location within the character cell matrix. Programs often use
this fn to indicate "insert mode" vs. "overstrike mode". You can
also use it to turn off the blinking cursor altogether.
CH selects the start of the cursor, in terms of the character cell
matrix. For instance, if CH=0, the cursor will start at the top
of the cell matrix.
CL selects the end of the cursor, in terms of the character cell
matrix. This setting usually depends on the height of the cell
matrix.
On EGA/VGA, you may check the word at 0040:0085 to see how many
scan lines per character are used in the current video mode. On
VGA you may use INT 10H 1bH to obtain the size of the character
matrix.
CGA 25-line mode
EGA 43-line mode
VGA 25 EGA 25 VGA 50-line mode
■■■■■■■■■ 0 ■■■■■■■■■ 0 ■■■■■■■■■ 0
■■■■■■■■■ 1 ■■■■■■■■■ 1 ■■■■■■■■■ 1
■■■■■■■■■ 2 ■■■■■■■■■ 2 ■■■■■■■■■ 2 ┌─────────────────────┐
■■■■■■■■■ 3 ■■■■■■■■■ 3 ■■■■■■■■■ 3 │■ = cell point │
■■■■■■■■■ 4 ■■■■■■■■■ 4 ■■■■■■■■■ 4 │■ = descender area │
■■■■■■■■■ 5 ■■■■■■■■■ 5 ■■■■■■■■■ 5 │■ = gap between lines│
■■■■■■■■■ 6 ■■■■■■■■■ 6 ■■■■■■■■■ 6 └─────────────────────┘
■■■■■■■■■ 7 ■■■■■■■■■ 7 ■■■■■■■■■ 7
■■■■■■■■■ 8 ■■■■■■■■■ 8 8
■■■■■■■■■ 9 ■■■■■■■■■ 9 9
■■■■■■■■■ 10 ■■■■■■■■■ 10 10
■■■■■■■■■ 11 ■■■■■■■■■ 11 11
■■■■■■■■■ 12 ■■■■■■■■■ 12 12
■■■■■■■■■ 13 ■■■■■■■■■ 13 13
■■■■■■■■■ 14 14 14
■■■■■■■■■ 15 15 15
However, you can use CL=1fH to set the bottom of the cursor at
the bottom of the character cell
Notes: ■ One way to turn off the cursor is to set CH and CL both to 20H.
Another way its to position the hardware cursor below the
bottom of the screen (INT 10H 02H). When the blinking cursor
is hidden, you may wish to display your own, non-blinking
cursor (for instance, ASCII 219 (█) or 220 (▄).
■ Older PC/CGA BIOSes supported odd cursor shapes, including
"wrap-around" cursors with a gap in the middle. In many later
BIOSes, the start line should be less than the end line.
■ The original "standard" cursor-handling technique is to thicken
the cursor when the keyboard is in "insert mode". Later, many
products stopped doing this; they leave the cursor the same
size, regardless of input mode or toggle the shape on a mode
change.
I, for one, prefer the reliable visual feedback of the original
standard.
■ EGA/VGA systems can be set to "emulate" CGA cursor size. When
emulation is in effect, the values of CL and CH are assumed to
be relative to a 8x8 character matrix and are scaled up,
according to the actual size of the character matrix. See
INT 10H 12H BL=34H and the EgaMiscInfoRec.
See Also: INT 10H: Video Services
INT 10H 03H (query cursor position/shape)
INT 10H 12H BL=34H (VGA: cursor emulation/scaling)
INT 10H 1bH (VGA: Query functionality/state)
-♦-