This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: gas non support of conditionnal jumps
- From: François Robichaud <frobichaud at hotmail dot com>
- To: Gnu As Mailing-List <binutils at sourceware dot org>
- Date: Mon, 29 Sep 2008 13:49:52 -0400
- Subject: RE: gas non support of conditionnal jumps
Hi there,
I'm a bit new to gas and I can read about conditionnal jumps in the i386 arch specifications that:
"This is accomplished by using byte (8-bit) displacement
jumps whenever the target is sufficiently close. If a byte displacement
is insufficient a long displacement is used. We do not support
word (16-bit) displacement jumps in 32-bit mode (i.e. prefixing the jump
instruction with the `data16' instruction prefix), since the 80386
insists upon masking `%eip' to 16 bits after the word displacement
is added." [...] Note that the `jcxz', `jecxz', `loop', `loopz',
`loope', `loopnz' and `loopne' instructions only come in byte
displacements, so that if you use these instructions (gcc does
not use them) you may get an error message (and incorrect code).
I find this a bit inconvinient as the solution proposed seems anything but efficient. It says that I "may" get an error. That is can I get around this limitation with the nojumps/jump switch detailed in the i386 arch section:
" Following the CPU architecture (but not a sub-architecture, which are those
starting with a dot), you may specify `jumps' or `nojumps' to
control automatic promotion of conditional jumps. `jumps' is the
default, and enables jump promotion; All external jumps will be of the long
variety, and file-local jumps will be promoted as necessary.
(see i386-Jumps) `nojumps' leaves external conditional jumps as
byte offset jumps, and warns about file-local conditional jumps that
as promotes.
Unconditional jumps are treated as for `jumps'. "
Whether there is something or nothing to do about this, can you help me understand the theory behing that?
François Robichaud-Rincon
_________________________________________________________________