Microsoft KB Archive/19851

Function 10 - Set Text Cursor PSS ID Number: Q19851 Article last modified on 05-14-1993 PSS database name: H_Mouse

3.x 4.x 5.x 6.x 7.x 8.x 9.00

MS-DOS

Summary:

This article explains Function 10, which is used to define the mouse text cursor.

FUNCTION 10: - SET TEXT CURSOR

Inputs:

AX = 10 BX = 0 --> select software text cursor BX = 1 --> select hardware text cursor CX = screen mask / scan line start DX = cursor mask / scan line stop Outputs: none

Software Text Cursor
CX and DX select screen and cursor masks, which are defined below.

bit: F E D C B A 9 8 7 6 5 4 3 2 1 0 b bkgnd i forgd ——char—– b = 1 –> blinking cursor = 0 –> nonblinking cursor bkgnd: E –> red component of background (1 = on, 0 = off) D –> Green component of background (1 = on, 0 = off) C –> Blue component of background (1 = on, 0 = off) i = 1 –> high intensity foreground = 0 –> low intensity foreground forgd: A –> red component of foreground (1 = on, 0 = off) 9 –> Green component of foreground (1 = on, 0 = off) 8 –> Blue component of foreground (1 = on, 0 = off)

To create the cursor, the screen mask is ANDed with the displayed word; the result then is XORed with the cursor mask. Thus, if the below screen and cursor masks are set, the fore and background colors are inverted (bitwise):

b bkgnd i forgd --char- screen mask: 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 77ffh cursor mask: 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 0 7700h

Note that with the above CHAR masks, the underlying character always shows “through” the cursor. For example, if the screen mask is set to 7700h and the CURSOR mask is 7700h, the character under the cursor is always invisible.

Example: b bkgnd i forgd ——char—– screen mask: 0 1 1 1 0 1 1 1 0 1 0 0 1 1 1 1 774fh cursor mask: 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 0 7700h

In the case above, only upper case alpha characters from A-O and the “@” sign are visible underneath the cursor.

Hardware Text Cursor
The SCAN lines are as follows:

HGC - 14 scan lines, numbered from 0 to 13 CGA - 8 scan lines, numbered fro 0 to 7 EGA - CGA display –> 8 scan lines, numbered fro 0 to 7 EGA display –> 14 scan lines, numbered from 0 to 13

Scan lines are numbered from top to bottom (TOP = 0). The default start/stop values for CGA are 6/7. Please note that the hardware text cursor always blinks. This is a built-in function; it cannot be changed by the mouse.

Additional reference words: 7.00 7.04 7.05 8.00 8.10 8.20 9.00

Copyright Microsoft Corporation 1993.