
;************************************************************************
; Change character at the current cursor position to                    *
; 'reverse' video character                                             *
;************************************************************************

        PUBLIC  _BIOS_Invert

_BIOS_Invert    PROC NEAR
        MOV     AH,8                    ;Function = READ CHARACTER & ATTRIBUTE
        MOV     BH,0                    ;from page 0
        INT     10H                     ;Ask BIOS to fetch character
                                        ; AL has a character to write
                                        ; BH still has page to write to
        MOV     BL,AH                   ;Fetch attribute we have just received
        NOT     BL                      ;Invert attribute
        AND     AH,88H                  ;Preserve 'blink' & 'char gen' bits
        OR      BL,AH
        MOV     CX,1                    ;Number of characters to write
        MOV     AH,9                    ;Function = WRITE CHARACTER & ATTRIBUTE
        INT     10H                     ;Use BIOS to write attribute
        RET
_BIOS_Invert    ENDP
