Solved

change bank with vesa

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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 …

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now