How do i print a string with a bright white forground and bright blue background? Also, how do i print a string without moving the cursor?
Printable View
How do i print a string with a bright white forground and bright blue background? Also, how do i print a string without moving the cursor?
the best way to do both of those things is to put the string into memory yourself
it starts at b800:0000 - even bytes are chars and odd bytes are attributes
so, for instance, to put the char '$' in the top left with bright white on blue:
Code:; es:di = location of string
mov al,'$'
mov ah,01Fh
; the 1 means blue, the F means bright white
; bits 0-3 = foreground, 4-7 = background
stosw
You should use the REP statement in conjunction with the STOSW for the length of the string to quickly display the string to the screen if the string is more than one character.
NOTE: Make sure you multiply the length by 2 before you "machine gun" it to the screen.