Advertisement Jump to content


This topic is now archived and is closed to further replies.


console text color in asm?

This topic is 5368 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m making a text-based game with TASM, but I can''t figure out how to color the text. Is there an interrupt for it or something? Thx in advance. ----------------------------------------------- Here comes the Thnikkaman!

Share this post

Link to post
Share on other sites
When writing directly to memory at 0xB8000, you first put an attribute bit that describes the color of the character before every character. Bit''s 0-3 of that bit specify the foreground color, bits 4-6 specify the background color, and bit 7 specifies if the character is blinking or not. Your options for colors are (in order starting with 000): black, blue, green, cyan, red, magenta, brown/yellow, and gray. Bit 3 is an intensity bit that you can use for a brightness control on foreground colors. You would use this if you wanted to get white.

This is how old Apogee games did those ending screens... they''d have a file full of attribute/character pairs and just dump the whole thing to 0xb8000 when the program ended. In all practicality, you''ll be better off looking up ANSI escape codes since they work on more platforms than just DOS. Do a Google search on them for info.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!