Mail Archives: djgpp/1999/08/10/17:31:06
Mike Nansgar wrote:
>
> I am writing VESA VBE 2.0 routines using a combination of DJGPP and
> NASM. It seems as if my code (which calls the NEAR p-mode code) half
> works; it does set the page because when I write to the video, it sets
> the right pixels. But immediately after setting them it crashes with a
> GPF at my 'rep stosd' instruction! The same 'rep stosd' works perfectly
> when used with the set bank interrupt. Any help would be greatly
> appreciated. Thanks in advance!
>
> /* My DJGPP Pointer (the VESAPMInfo struct has the right data): */
>
> void *VESA_PMPgFn = (void *)((char *)VESAPMInfo +
> VESAPMInfo->SetWindow);
>
> ;My NASM v0.98 Routine (Inputs: DX - the page number):
>
> [EXTERN _VESA_PMPgFn]
> VESA_SetBank:
> xor BX,BX
> call [_VESA_PMPgFn]
> ret
>
> Mike Nansgar
> mnansgar AT hotmail DOT com
The pointer to the setwindow function is an absolute address. If you are
making the call in near mode, you need to factor in the offset of your
program's base address so that you are referencing memory from a base of
0, and not your program.
Try *adding* __djgpp_convetional_base to VESA_PMPgFn to get the function
pointer you really need.
moogla
- Raw text -