## Display Device Driver Reference for OS/2

[prev][next][parent][TOC]

### Function F1H - Write One Register

This function writes data to a specified register on the EGA. When an application program returns from a call to Function F1, the contents of registers BH and DX are not restored. The program must save and restore these registers.

Input

AH = F1h

BL = Pointer for pointer/data chips. Data for single registers.

BH = Data for pointer/data chips. Ignored for single registers.

DX = Port number:

Pointer/data chips

0h: CRT Controller (3?4H)
8h: Sequencer (3C4H)
10h: Graphics Controller (3CEH)
18h: Attribute Controller (3C0H)

Single registers

20h: Miscellaneous Output register (3C2H)
28h: Feature Control register (3?AH)
30h: Graphics 1 Position register (3CCH)
38h: Graphics 2 Position register (3CAH)

? = B for monochrome modes or D for color modes

Output

AX: Restored
BL: Restored
BH: Not restored
DX: Not restored

All other registers are restored.

Example

The following example writes the contents of myvalue into the CRT Controller Cursor Start register:

    myvalue db   3h
            mov  ah, 0f1h        ; f1 = write one register
            mov  bh, myvalue     ; bh = data from myvalue
            mov  bl, 000ah       ; bl = cursor start index
            mov  dx, 0000h       ; dx = crt controller
            int  10h             ; write it!

The example below writes the contents of myvalue into the Feature Control register:

    myvalue db   2h
            mov  ah, 0f1h        ; f1 = write one register
            mov  bl, myvalue     ; bl = data from myvalue
            mov  dx, 0028h       ; dx = feature control register
            int  10h             ; write it!