home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGASM.ZIP / PROG052.ASM < prev    next >
Assembly Source File  |  1988-04-10  |  1KB  |  24 lines

  1.  
  2. ;************************************************************************
  3. ; Change character at the current cursor position to                    *
  4. ; 'reverse' video character                                             *
  5. ;************************************************************************
  6.  
  7.         PUBLIC  _BIOS_Invert
  8.  
  9. _BIOS_Invert    PROC NEAR
  10.         MOV     AH,8                    ;Function = READ CHARACTER & ATTRIBUTE
  11.         MOV     BH,0                    ;from page 0
  12.         INT     10H                     ;Ask BIOS to fetch character
  13.                                         ; AL has a character to write
  14.                                         ; BH still has page to write to
  15.         MOV     BL,AH                   ;Fetch attribute we have just received
  16.         NOT     BL                      ;Invert attribute
  17.         AND     AH,88H                  ;Preserve 'blink' & 'char gen' bits
  18.         OR      BL,AH
  19.         MOV     CX,1                    ;Number of characters to write
  20.         MOV     AH,9                    ;Function = WRITE CHARACTER & ATTRIBUTE
  21.         INT     10H                     ;Use BIOS to write attribute
  22.         RET
  23. _BIOS_Invert    ENDP
  24.