This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gas jmp problems


On Sun, Jul 01, 2001 at 12:26:52PM -0700, Mr Bro wrote:
> 
> I skimmed through manuals and ChangeLogs and couldn't
> find a reference to it, and decided to ask before
> diving into the source.  Any help is appreciated.
> 
> Using the following code: main(){__asm__("jmp 13");}
> gas correctly produces near jmp opcode with binutils
> shipped with Red Hat 6.1 (binutils-2.9.1.0.23-6), i.e.
> it produces
> 
> \xeb\x0d

"jmp 13" is illegal assembly.  Older gnu assemblers accept it, but
it's really a bug.

> But with more recent binutils (like the one shipped
> with Red Hat 6.2), it fails to do so and produces far
> jmp opcode:
> 
> \xe9\x89\x7b\xfb\xf7

Older versions of gcc generate assembly like "call 13" under certain
circumstances.  Rather than throw such invalid assembly out, we now
support it and generate the machine instructions that gcc intended.

> Could someone point out how to get gas to produce near
> jmp opcode with the latest versions?

 jmp .+2+13

Alan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]