Solved

Writing to a different video page

Posted on 1997-03-17
1
338 Views
Last Modified: 2008-03-10
How do I write to page 1, for instance, in text mode using video mode 3 and directly accessing the video memory?
In this mode video memory starts on 0xB800 I guess. But, if I write from this address I'll be writing to page 0 (as set by INT 10, AH=0x05). Documentation says there are four [0-3] available pages in this mode. I switched to page 1 using INT 10 - AH=0x05, but now how do I write to it? Shall I add an offset of 80X25 = 2000?
0
Comment
Question by:pneves
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
indian earned 5 total points
ID: 1249728
INT 10 - function 05h actives the page you want to see in the screen not the page you want to write to, so of course you must add an offset (base adress is always B800h), but this is not 2000 but 4000 because each cell is represented by two bytes (ASCII code and ATTRIBUTE).

This is the formula in 80x25 mode:

offset = P * PageSize + Y * 160 + 2 * X + B

where P is the page (0-3).
      B = 0 if you want to write the ASCII code.
        = 1 if you want to write the attribute.
      PageSize = 80 x 25 * 2 = 4000.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question