Home arrow C++ arrow Page 4 - Video Memory Programming in Text Mode

Video Memory Programming in Text Mode

Nowadays we take so many things for granted. This isn't necessarily a bad thing, as knowing that performing a certain task will usually yield the same result can be a blessing. Nevertheless, some basic knowledge of how a thing gets done lets you better understand the world in which we live. Therefore, today I invite anyone who likes to code in any of the popular languages to see how a word gets printed out on the console screen.

Author Info:
By: Gabor Bernat
Rating: 4 stars4 stars4 stars4 stars4 stars / 10
March 29, 2010
  1. · Video Memory Programming in Text Mode
  2. · Where to copy
  3. · The code
  4. · What do we have in the end?

print this article

Video Memory Programming in Text Mode - What do we have in the end?
(Page 4 of 4 )

The code snippet on the previous page will deliver first a letter in the upper left corner, and a music key in the center of the screen.


For the clean screen I will not post an image (surely you can imagine a black screen), however, the printing out of the code file itself is worth a couple of comments. The file name you need to use is the one the IDE itself sees. The long folder and file names are cut off and replaced with some numbers at the end, as you can see in my example.



The background color we set previously will appear only the first time, because afterward I use the clear function I wrote to clear previous information off of the screen, and this also resets the background color. Nevertheless, you are free to write a custom clear function that may skip writing to the locations specifying the background color. Using the peekb function to read out the previous background color and set it again after clearing it is also an option. I will leave these to you.


Next time we meet I will show you how to write to the video memory using the graphic mode. This will leave you the option of printing blazing fast lines, rectangles and circles on the user's screen. Until that you may post questions you have here on the blog following the article or join the DevHardware community. Live With Passion!

DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus

- Intel Threading Building Blocks
- Threading Building Blocks with C++
- Video Memory Programming in Text Mode
- More Tricks to Gain Speed in Programming Con...
- Easy and Efficient Programming for Contests
- Preparing For Programming Contests
- Programming Contests: Why Bother?
- Polymorphism in C++
- Overview of Virtual Functions
- Inheritance in C++
- Extending the Basic Streams in C++
- Using Stringstreams in C++
- Custom Stream Manipulation in C++
- General Stream Manipulation in C++
- Serialize Your Class into Streams in C++

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials