Solved

change bank with vesa

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

713 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