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.
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.