## Display Device Driver Reference for OS/2

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

### Function F5H - Write Register Set

This function writes data to a set of registers on the EGA. A set of registers is defined to be several registers that might have consecutive indexes, and that might be on the same chip.

Input

AH = F5h

CX = Number of registers (must be >1)

ES:BX = Points to table of values with each entry in this format:

Bytes 1-2: 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

Byte 3: Pointer value (0 for single registers)

Byte 4: Data to be written to register specified in bytes 1-3.

Output

AX: Restored
BX: Restored
CX: Not restored
ES: Restored.

All other registers are restored.

Example

The following example writes the contents of outvals to the Miscellaneous Output register, Sequencer Memory Mode register, and CRT Controller Mode Control register:

    outvals dw   0020h               ; miscellaneous output register
            db   0                   ; 0 for single registers
            db   0a7h                ; output value
            dw   0008h               ; sequencer
            db   04h                 ; memory mode register index
            db   03h                 ; output value
            dw   0000h               ; crt controller
            db   17h                 ; mode control register index
            db   0a3h                ; output value
            mov  ax, ds              ; assume outvals in data segment
            mov  es, ax              ; es = data segment
            mov  bx, offset outvals  ; es:bx = outvals address
            mov  ah, 0f5h            ; f5 = write register set
            mov  cx, 3               ; number of entries in outvals
            int  10h                 ; write the registers!