This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: gas generating bad code for i386
- To: Alan Modra <alan at SPRI dot Levels dot UniSA dot Edu dot Au>
- Subject: Re: gas generating bad code for i386
- From: Tom Riddle <ftr at oracom dot com>
- Date: Thu, 09 Mar 2000 10:22:47 -0500
- CC: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>, ian at zembu dot com, binutils at sourceware dot cygnus dot com
- Organization: Oracom Inc.
- References: <Pine.LNX.4.10.10003091009520.11226-100000@mullet.itr.unisa.edu.au>
Alan Modra wrote:
>
> gas did have a rather useless and probably unintentional "feature" in that
> it accepted `jmp constant' (and `call constant', `jc ...' etc.) and
> generated a `jmp' opcode with `constant' as the operand. ie. you got a
> jmp, with offset `constant' relative to the *next* instruction. All quite
> confusing really.
>
Yes, and this 'feature' disappeared somewhere between 2.9.1.0.23 and
2.9.5.0.22
and this was the cause of my problem. I must admit that 'call 4' seemed
a little strange at the time that I wrote it, but it worked. I haven't
done assembly in a while and was having trouble remembering the
PC-relative
syntax. I have since changed the code as per Ian's suggestion - except
it's .+6, not 4.
Thanks to all for your help,
Tom
--
Tom Riddle
Oracom, Inc.
http://www.oracom.com
Tel. +1 978.557.5710x305
Fax +1 978.557.5716