Solved

change bank with vesa

Posted on 2001-08-02
3
203 Views
Last Modified: 2006-11-17
what is the value on the dx register when i call int10h with the ax value of 4f05h?
how do i calculate it?
0
Comment
Question by:cyberia_2ooo
[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
  • 2
3 Comments
 
LVL 24

Expert Comment

by:SunBow
ID: 6345381
Q> what is the value on the dx register

(don't neglect BX)

A> WinGranularity

WinGranularity specifies the smallest boundary, in KB, on which the window can be placed in the frame buffer memory. The value of this field is undefined if Bit D0 of the appropriate WinAttributes field is not set.

(from http://members.ozemail.com.au/~fret/vesa2.html):

Display Window Control

This required function sets or gets the position of the specified display window or page in the frame buffer memory by adjusting the necessary hardware paging registers.  To use this function properly, the software should first use VBE Function 01h (Return VBE Mode information) to determine the size, location and granularity of the windows.

For performance reasons, it may be more efficient to call this function directly, without incurring the INT 10h overhead.  VBE Function 01h returns the segment:offset of this windowing function that may be called directly for this reason.  Note that a different entry point may be returned based upon the selected mode.  Therefore, it is necessary to retrieve this segment:offset specifically for each desired mode.
 
 Input:
 AX  0x4F05 - VBE Display Window Control
 BH 0x00 Set memory window
    0x01 Get memory window
 BL 0x00 Window A
    0x01 Window B
 DX Window number in video memory in window granularity units (Set Memory Window only)

 Output:
 AX VBE Return Status
 DX Window number in window granularity units (Get Memory Window only)

...Also, in the far call version, the AX and DX registers will be destroyed...

0
 

Author Comment

by:cyberia_2ooo
ID: 6346236
thanx
but my question was how do i calculate it.
here is a part of a code that a friend of mine gave me, this part is the part in the code that reffers to the DX register.
gran - windows granulrity
x - the x coordinet
y - the y coordinet
xsize - the width of the screen, in that case 640.
the code:

mov ax,y
mov bx,xsize
mul bx
add ax,x
mov cx,ax
jnc noCarry
inc dx

noCarry:
mov ax,dx
mul gran
mov dx,ax


this is the only part that reffers to the dx register befor calling the 4f05h to flip page
0
 
LVL 24

Accepted Solution

by:
SunBow earned 5 total points
ID: 6346795
I have not programmed this yet, FWIW.

The quote I gave you suggests using other interrupt. AND, that you can do a get on it (no math) before a set (put or a write). I answered your first question.

Your code in last comment looks like you answered your second question.  Now what?

Have you tried it? What does not work?

If next instruction is the INT 10 call, then I am certainly at a loss on the handling of BX, where my quote has only two options, 0 & 1 for each of BH & BL, which certainly got clobbered to something else when used for multiplication in the calculation for DX above.
0

Featured Post

Industry Leaders: 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

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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