Date: Thu, 1 Jun 2000 14:51:32 +0200 (MET DST) From: Gisle Vanem To: djgpp AT delorie DOT com cc: eliz AT is DOT elta DOT co DOT il Subject: Re: Inline asm: lcall & various binutils versions Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Eli Zaretskii > 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.