Mail Archives: djgpp/1997/10/05/11:00:58
On Wed, 1 Oct 1997, Nate Eldredge wrote:
> >i'm porting a Borland program to DJGPP and can't figure out how to
> >workaround the Borland _psp global variable.
> The _psp variable is the segment of your PSP, right? DJGPP stores this in
> _go32_info_block.linear_address_of_original_psp.
I suggest to use function 62h of the DOS interrupt 21h (it returns in
the BX register the same value that you get in `_psp' under Borland),
instead of using linear_address_of_original_psp.
The reason for this recommendation is that when a DJGPP program runs
under a debugger, it gets a copy of the real PSP, and so using the
linear address provided in `_go32_info_block' could yield stale values
(depending on what parts of the PSP do you need to access). Using the
DOS interrupt gets you consistent results both stand-alone and under a
debugger.
- Raw text -