Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
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
 Map                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
;* 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 (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:PWORD
 
        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
                                    -♦-