TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: WIM KONING
from: HUGH NOLAND
date: 1997-11-27 10:50:00
subject: Pascal`s TextColor

WK> INT 10 - VIDEO - WRITE CHARACTER AND ATTRIBUTE AT CURSOR POSITION
WK>         AH = 09h
WK>         AL = character to display
WK>         BH = page number (00h to number of pages - 1) (see #0009)
WK>             background color in 256-color graphics modes (ET4000)
WK>         BL = attribute (text mode) or color (graphics mode)
WK>             if bit 7 set in <256-color graphics mode, character is XOR'ed
WK>               onto screen
WK>         CX = number of times to write character
WK> Return: nothing
WK> Notes:  all characters are displayed, including CR, LF, and BS
WK>         replication count in CX may produce an unpredictable result in 
graphics
WK>           modes if it is greater than the number of positions remaining 
in the
WK>           current row
WK> SeeAlso: AH=08h,AH=0Ah,AH=4Bh"GRAFIX",INT 17/AH=60h,INT 1F"SYSTEM DATA"
WK> SeeAlso: INT 43"VIDEO DATA",INT 44"VIDEO DATA"
WK>
WK> ?(?(? That's not it, is it? I don't know, I don't understand it..
 
   That's it.  Example:
   mov ah,9               ;function #
   mov al,'A'             ;character to display
   mov bh,0               ;text page number = 0
   mov bl,0eh             ;text color attributes...in this case yellow on 
black
                          ;the first hex digit is background color, the 
econd
                          ;is text color
   mov cx,1               ;if you put #xx in cx, then the character will be
                          ;written xx times
   int 10h                ;write character at cursor position
   The result is to write a yellow 'A' on a black background at the cursor
   position.
 
   Note: This will not advance the cursor.  You can do that in various ways,
   one of which is:
   mov ah,0eh
   mov al,' '
   mov bh,0
   int 10h
 
   Or shorter:
   mov ah,2
   mov dl,' '
   int 21h
--- Maximus/2 3.01
---------------
* Origin: Madman BBS * Chico, California * 530-893-8079 * (1:119/88)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.