Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
ReadCharAttr
◄Example► ◄Back► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
;* ReadCharAttr - Reads character and display attribute at cursor location.
;*
;* Shows: BIOS Interrupt - 10h, Function 8 (Read Character and Attribute
;* at Cursor)
;*
;* Uses: vconfig - Video configuration structure, declared in the
;* DEMO.INC include file. The structure must first be
;* initialized by calling the GetVidConfig procedure.
;*
;* Params: attr - Pointer to short integer for display attribute
;*
;* Return: Short integer with ASCII value of character
ReadCharAttr PROC \
USES di, \
attr:PTR WORD
mov ah, 8 ; Function 8
mov bh, vconfig.dpage ; Current page
int 10h ; Read Character and Attribute
sub bh, bh
mov bl, ah ; BX = attribute
cbw ; AX = character
LoadPtr es, di, attr ; ES:DI = pointer to int
mov es:[di], bx ; Copy attribute
ret
ReadCharAttr ENDP
-♦-