change bank with vesa

what is the value on the dx register when i call int10h with the ax value of 4f05h?
how do i calculate it?
cyberia_2oooAsked:
Who is Participating?
 
SunBowConnect With a Mentor Commented:
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
 
SunBowCommented:
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
 
cyberia_2oooAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.