|
-
Jun 27th, 2001, 09:39 PM
#1
Printing string
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?
-
Jun 29th, 2001, 07:39 PM
#2
Junior Member
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
-
Jul 21st, 2003, 05:50 PM
#3
Fanatic Member
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.
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|