Mail Archives: djgpp/2000/06/01/08:54:08
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
> On Thu, 1 Jun 2000, Gisle Vanem wrote:
>
> > But I think he meant wrong alignment of
> > '__dpmi_paddr.selector'. Without some #pragma's around '__dpmi_paddr',
> > the long-call *could* cause a crash.
>
> I'd prefer to solve this without #pragma's. What exactly is wrong with
> the current layout of __dpmi_paddr, if used in an lcall?
"lcall (%%edi)" is an indexed far call. 'edi' must point to a 48-bit
address block. This block ('__dpmi_paddr') must have a layout as defined
by Intel for an indexed far call opcode.
First 32-bit must be a linear offset and immediatially followed by 16-bit
for a valid selector (bigendian layout). If gcc should optimise and align
'__dpmi_paddr.selector' differently it would no longer be a valid selector
at that address.
What's wrong with #pragma's anyway? Most compilers support it (even
gcc). I much prefer '#pragma pack' over the IMHO messy
'__attribute__((packed))' construction.
Gisle V.
- Raw text -