From: Robert Plantz <plantz@sonoma.edu>
To: A D <a_d_249@hotmail.com>
Cc: linux-assembly@vger.kernel.org
Subject: Re: Displacement def in as
Date: Wed, 22 Nov 2006 16:04:27 -0800 [thread overview]
Message-ID: <1164240267.5308.10.camel@ubuntu> (raw)
In-Reply-To: <BAY22-F18305A073A5C394A9BB360F5E30@phx.gbl>
If you are using the gnu assembler, gas, you should
become familiar with the info for it. The command
is
info as
Go to Machine Dependencies, then i386-Dependent,
then i386-Memory. There you will see that the AT&T
syntax is
DISP(BASE, INDEX, SCALE)
DISP is an integer. An example is
movl $0, -4(%ebp)
which would store 32 bits of zero at the
memory location starting 4 bytes negative
from the address in the ebp register. (This
instruction does not use INDEX or SCALE.)
Linux uses a flat memory model, so you don't
need to worry about the segmentation registers
if you run your program under Linux.
On Wed, 2006-11-22 at 18:44 -0500, A D wrote:
> I am a newbie and i have question. What does
> displacement mean according to segmented
> memory model? Does it mean anything in terms
> of Segment Descriptor? Thanks.
>
> Offset = Base + (Index * Scale) + displacement
>
next prev parent reply other threads:[~2006-11-23 0:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-22 23:44 Displacement def in as A D
2006-11-23 0:04 ` Robert Plantz [this message]
2006-11-23 2:56 ` A D
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1164240267.5308.10.camel@ubuntu \
--to=plantz@sonoma.edu \
--cc=a_d_249@hotmail.com \
--cc=linux-assembly@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.