Glenn Verdins wrote:
> How do i write a string to the screen, but being able to specify a text
> attribute? Like the Mov Ah,9 Int 21 function, only with colors?
DOS (int 21) doesn't seem to support it, but you can use int 10 service 13
or direct screen writes. My own feelings are that it is easier to use
direct writes. The color text screen starts at B800:0000 and begins with
the character, the next location (0001) contains the color attribute.
The 80x25 text screen is 2000 characters plus 2000 attributes, for a total
of 4000 memory locations.
C=character, A=attribute
CACACACACACACACACACACACA, etc.
Here's an example, cheating a bit in using SPACES for the color
attribute:
cseg segment
assume cs:cseg
org 100h ;CS=DS=ES=SS, COM file.
os equ offset
_txt struc
t1 db "H e l l o W o r l d ! "
_txt ends
Begin:
mov ax,0B800h
mov es,ax
mov cx,12
mov si,os txt.t1
mov di,160*10
rep movsw
int 20h
txt _txt
cseg ends
end Begin
... The Moon is Waxing Gibbous (73% of Full)
--- ifmail v.2.10-tx8.2
---------------
* Origin: (jvahn@short.circuit.com) (1:346/15.1)
|