Solved

change bank with vesa

Posted on 2001-08-02
3
196 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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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 …

778 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