TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: GLENN VERDINS
from: HUGH NOLAND
date: 1997-06-15 12:52:00
subject: text attribute

GV> How do i write a string to the screen, but being able to specify a text
GV> attribute?
GV>
GV> Like the Mov Ah,9 Int 21 function, only with colors?
 
Check out int 10h, function 13h.  The following program illustrates
the use of this function.
 
;---------------------------------------------------------------------
;A program to illustrate the use of the BIOS write_string function.
;---------------------------------------------------------------------
cseg segment
assume cs:cseg, ds:cseg
org 100h
 
begin: jmp main
 
buf       db     "This is my test string--printed out as"
          db     "yellow text on a black background.",13,10
len       dw     $ - buf
 
main:
   mov ah,13h                    ;write_string function (int 10h)
   mov al,0
   mov bl,0eh                    ;color attribute yellow on black
   mov bh,0                      ;page
   mov dh,20
   mov dl,2                      ;dh,dl = row, col of start of string output
   mov cx,len                    ;cx holds length of string
   mov bp,offset buf             ;es:bp==>start of string
   int 10h
 
   mov ax,4c00h
   int 21h
cseg   ends
end   begin
 
             --Hugh Noland--
--- Maximus/2 3.01
---------------
* Origin: Madman BBS * Chico, California * 916-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™.