* Displacement def in as
@ 2006-11-22 23:44 A D
2006-11-23 0:04 ` Robert Plantz
0 siblings, 1 reply; 3+ messages in thread
From: A D @ 2006-11-22 23:44 UTC (permalink / raw)
To: linux-assembly
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
_________________________________________________________________
Off to school, going on a trip, or moving? Windows Live (MSN) Messenger lets
you stay in touch with friends and family wherever you go. Click here to
find out how to sign up! http://www.telusmobility.com/msnxbox/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Displacement def in as
2006-11-22 23:44 Displacement def in as A D
@ 2006-11-23 0:04 ` Robert Plantz
2006-11-23 2:56 ` A D
0 siblings, 1 reply; 3+ messages in thread
From: Robert Plantz @ 2006-11-23 0:04 UTC (permalink / raw)
To: A D; +Cc: linux-assembly
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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Displacement def in as
2006-11-23 0:04 ` Robert Plantz
@ 2006-11-23 2:56 ` A D
0 siblings, 0 replies; 3+ messages in thread
From: A D @ 2006-11-23 2:56 UTC (permalink / raw)
To: plantz; +Cc: linux-assembly
>Robert Plantz wrote:
>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.
Thank you Robert Plantz for your wonderful insight.
--STeve
_________________________________________________________________
Off to school, going on a trip, or moving? Windows Live (MSN) Messenger lets
you stay in touch with friends and family wherever you go. Click here to
find out how to sign up! http://www.telusmobility.com/msnxbox/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-11-23 2:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-22 23:44 Displacement def in as A D
2006-11-23 0:04 ` Robert Plantz
2006-11-23 2:56 ` A D
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).