Mail Archives: djgpp/1999/01/13/04:03:27
Use this:
#include <crt0.h>
void * MK_FP (unsigned short seg, unsigned short ofs)
{
if ( !(_crt0_startup_flags & _CRT0_FLAG_NEARPTR) )
if (!__djgpp_nearptr_enable ())
return (void *)0;
return (void *) (seg*16 + ofs + __djgpp_conventional_base);
}
Alex Lowe wrote:
> I am trying to port some code, for reading the fonts in ROM for DOS.
> Anyway, what I need to do is to get the memory location of this... I
> have 2 pointers... segment and offset...
>
> And I want to have the pointers added, for example if the segement is
> 0xAA and the offset is 0x03 then I can make a pointer to 0xAD...
>
> The code I am trying to port looks like this:
>
> char *offset=regs.x.bp;
> char *segment=regs.x.es;
>
> char *font=*MK_FP(segment, offset);
>
> That is the code... the last line is the one I am having trouble with...
> Thanks for the info, I hoped I described this well enough.
>
> -- Alex
- Raw text -