delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/26/05:54:54

From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Inline asm: lcall & various binutils versions
Date: Wed, 26 Apr 2000 09:48:37 +0200
Organization: NetVision Israel
Lines: 41
Message-ID: <39069F55.639FE192@is.elta.co.il>
References: <39060495 DOT 8CA597B0 AT bigfoot DOT com>
NNTP-Posting-Host: ras1-p70.rvt.netvision.net.il
Mime-Version: 1.0
X-Trace: news.netvision.net.il 956731698 25721 62.0.172.72 (26 Apr 2000 06:48:18 GMT)
X-Complaints-To: abuse AT netvision DOT net DOT il
NNTP-Posting-Date: 26 Apr 2000 06:48:18 GMT
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en,ru,hebrew
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Richard Dawe wrote:
> 
> (*) This array may be too big in total byte-size, but it works. When I
> change it to a short, GPFs are generated. I wonder if this is because INT
> 0x2F, subfunction 0x1684 returns a selector:offset pair in protected mode,
> i.e. 16-bit:32-bit, whereas it returns 16-bit:16-bit in real mode (as
> listed in Ralph Brown's Interrupt List).

No, I think the VxD entry point is always 16:16 bit.  The problem is probably
in how the inline assembly and Gas handle a `short' variable.  I'm guessing
that the offset somehow get loaded into a 32-bit register, with garbage in
the high 16 bits.

> My first problem is this: binutils 2.8.1 & cross-binutils 2.9.1.0.4 were
> happy with the 'lcall _entrypoint' syntax. binutils 2.9.5.1 beta is OK,
> but warns that without a '*' the address is a relative address.

Yes, this is one of the incompatible changes in the latest versions of
Binutils.

> What syntax should I use? Should this be a far call (i.e. lcall rather
> than call)?

AFAIK, it *must* be a far call, since the address includes a selector.

> Should I instead use a syntax like:
> 
> lcall *_entrypoint[1]:_entrypoint[0]

Probably worth trying, but I have no idea how to say this in inline
assembly.  Anybody?

> I guess I should I move away from a two-int structure to something like
> this:
> 
> struct entrypoint {
>     short selector;
>     int offset;
> };

I'm not sure.  This even can crash and burn, due to padding.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019