www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/31/00:46:52

From: Richard Dawe <richdawe AT bigfoot DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Inline asm: lcall & various binutils versions
Date: Tue, 30 May 2000 21:00:34 +0100
Organization: Customer of Planet Online
Lines: 40
Message-ID: <39341DE2.20CA1843@bigfoot.com>
References: <39060495 DOT 8CA597B0 AT bigfoot DOT com> <39069F55 DOT 639FE192 AT is DOT elta DOT co DOT il>
NNTP-Posting-Host: modem-157.chlorine.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news8.svr.pol.co.uk 959717351 20820 62.136.16.157 (30 May 2000 20:09:11 GMT)
NNTP-Posting-Date: 30 May 2000 20:09:11 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.14 i586)
X-Accept-Language: de,fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello.

Eli Zaretskii wrote:
> 
> Richard Dawe wrote:
> > 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.

I took a look at this problem at the weekend and I couldn't find a way to
avoid this syntax. I tried loading the selector into es and then
referencing the offset's memory location, like so:

lcall %%es:_myoffset

but this always resulted in a segmentation fault. The only way I could get
lcall to work was with the original syntax:

lcall _entrypoint

where entrypoint is an array of two shorts, index 0 being the offset and 1
the selector. In spite of binutils 2.9.5.1 beta generating a warning, it
generates the right code, looking at the disassembly. Relying on this
behaviour is probably wrong, but it seems to work. I have no idea how to
make it backward compatible with 2.8.1/forward compatible with 2.9.5.1
beta, so it seems I will just have to live with this.

My guess is that lcall gets the offset and selector out of memory
regardless of the segment you place in front of it, when you specify a
memory location. I guess I will find the real answer, if I look at the
sources for the lcall support in as for both binutils versions. Ah well.

Thanks the help anyway. Bye,

-- 
Richard Dawe
richdawe AT bigfoot DOT com ICQ 47595498 http://www.bigfoot.com/~richdawe/

- Raw text -


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