Mail Archives: djgpp/1997/11/03/09:44:33
On Mon, 3 Nov 1997, Brett Porter wrote:
> I've noticed that __dpmi_allocate_dos_memory has superseded (and much
> simplified) calling this DPMI function, over the
> _go32_dpmi_allocate_dos_memory equivalent.
No, they are two different functions (but use the same underlying DPMI
function). The older _go32 variety is also required if you want to write
code that will compile with DJGPP v1.x.
> But the routine gives you back just a selector and a segment.
Because the allocated block is aligned so that the offset is zero.
> So if I have a structure MyStruct, I want to call like this:
>
> movedata( _my_ds(), (int )&MyStruct, DosSelector, 0, sizeof( MyStruct));
>
> Is this right?
Yes. But beware of moving structs: gcc pads struct elements, unless you
explicitly tell it not to.
> Likewise when I pass the segment
> returned from the allocate to __dpmi_int with an es:ebx combination: I
> assume again that the allocation aligns it on a segment boundary?
Yes.
> (BTW, the code doesn't work... in case you haven't guessed :)
Then debug it. Or post it.
- Raw text -