TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: REJEAN LAMBERT
from: HUGH NOLAND
date: 1997-12-13 11:50:00
subject: Simple Dos/Bios calls

 
RL> Here's the setup:  I'm a pascal coder, and I use alot of embedded 
assembler in
RL> my programs.  Now I've started to write pure asm programs, and I have 
just one
RL> big nasty question:
RL>
RL>   How am I supposed to output colored text ????
RL>
RL> I've been able to put together a functional program using int 10h - 
h=13,
RL> which outputs a string with a specified text attribute, but it requires 
the
RL> output row and column.  Is there something else I can use that just uses 
the
RL> current position ?  Something closer to a writeln / printf than this ?
 
You could use int 10h, function 3 to read the cursor position, then use
function 13h to output the string.  Or you could use int 10h, function 9,
to write one character at a time:
 
   mov si,offset string    ;terminate the string with some convenient 
character,
                           ;say $
   mov bl,xx               ;where xx is the color attribute
   mov bh,0                ;text page number
   mov cx,1                ;write character once
 
m: mov ah,9
   mov al,[si]
   cmp al,'$'
   je exit
   int 10h
   inc si
   mov ah,0eh             ;
   mov al,' '             ;advance cursor
   int 10h                ;
   jmp m
 
exit:
 
--- 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™.