C++
  Home arrow C++ arrow Video Memory Programming in Text Mode
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
C++

Video Memory Programming in Text Mode
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2010-03-29

    Table of Contents:
  • Video Memory Programming in Text Mode
  • Where to copy
  • The code
  • What do we have in the end?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Video Memory Programming in Text Mode


    (Page 1 of 4 )

    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.

    Any half respectable book that tries to describe a new programming language starts with this. Let us print a sentence on the screen. The classic one is "Hello World!" of course, but some like to spice things up and use a more elaborate example. To get the text on the screen, most of the time you just call a function that will take care of the rest.

    However, getting any information on the screen isn't as simple for the operating system. Remember that an operating system needs to work on multiple types of hardware configurations, and the way that some information gets from the system memory to display some colors on your screen varies. To make life simpler for the OS and to avoid design chaos, some basic rules have been established that all hardware manufacturers follow at some level.

    The actual job of drawing something to the screen always falls to the video card. It has to carry the input data to your screen. Now we cannot assure a real time procession, as a sudden data burst may overload our bandwidth no matter how large that is. Therefore, all video cards have, at some level, some memory for their own usage.

    This memory also allows them to store data that they need frequently. Doing this relieves some pressure from the CPU, as recurring data needs to be transferred to the video card only once. If you are interested in how a CPU works in detail, I invite you to look up the article series I dedicated to this in my profile. Besides the technical description, I created a simple demo sketch of my words using the VHDL language.

    Returning to the video card, the device itself will in the future take care of getting the information from its memory to the screen. Think of this task as turning on or off a given color channel of the monitor at a given point on the screen, based on whether the value of a predetermined memory bit is zero or one. With this approach, all that the OS needs to do is copy the correct information from the system memory to a predetermined zone of the video card.

    More C++ Articles
    More By Gabor Bernat


     

    C++ ARTICLES

    - 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++
    - Advanced File Handling with Streams in C++
    - File Handling and Streams in C++







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 11 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek