Followup to: <[EMAIL PROTECTED]>
By author: "Mark H. Wood" <[EMAIL PROTECTED]>
In newsgroup: linux.dev.gcc
>
> On Thu, 29 Jun 2000, Martin v. Loewis wrote:
> [snip]
> > > On the i386 platform relative jumps are limited to an 8 bit signed
> > > offset. In order to jump further than this the jumps must be threaded (I
> > > may be wrong about this, in truth it has been a while since I did any
> > > assembly on the Intels).
> >
> > No. On the i386 platform, *all* jumps are PC-relative (except for the
> > indirect ones), so you can jump relatively to about any location you
> > want.
>
> My Intel Software Developer's Manual: Instruction Set Reference seems to
> be saying that things are more complex than that. Conditional jumps can
> be relative to CS (near jump) or relative to CS:EIP (short jump).
> Unconditional jumps can be relative to CS, relative to CS:EIP, or relative
> to a new value that the jump will load into CS (far jump). Only short
> jumps take any notice of the current EIP value. So all jumps are
> *segment*-relative, but not all are PC-relative.
>
Uh, no.
Only far jumps are absolute. Near jumps, may they be 8- (short), 16-
or 32-bit, are always PC-relative. Far jumps (those that include a
CS) are always absolute.
-hpa
--
<[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt