Linux assembly list
 help / color / mirror / Atom feed
From: Brian Raiter <breadbox@muppetlabs.com>
To: linux-assembly@vger.kernel.org
Subject: Re: Segmented or Flat model
Date: Wed, 23 May 2007 19:12:29 -0700	[thread overview]
Message-ID: <18004.62605.733392.766670@eidolon.muppetlabs.com> (raw)
In-Reply-To: <BAY133-F19ABEF1EEAD079FAD786D8F5350@phx.gbl>

> I need clarification to a particular gnu assembly question. When i
> write a code:
> 
> .section .data
> output:
>    .int 1
> 
> .section .text
> .globl _start
> _start:
>    movl $output, %ebx
>    ....
> 
> here what type of memory model is used for movl statement(flat or
> segmented)?

I suppose that depends on your target platform. Since you sent this to
linux-assembly, I'm going to assume that the answer is "flat". For all
practical purposes, there is no "segmented" memory model on 32-bit
x86 linux.

> Also how does movl knows which logical address to use? I mean how do
> variables get their logical address?

The linker is generally responsible for assigning actual addresses.
(The assembler can't do this because it doesn't know what other object
files will go into the final executable.)

b

  reply	other threads:[~2007-05-24  2:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-23 22:56 Segmented or Flat model A D
2007-05-24  2:12 ` Brian Raiter [this message]
2007-05-24  3:01   ` A D
2007-05-24  4:20     ` Brian Raiter
2007-05-24  5:02     ` Robert Plantz
2007-05-24 11:48       ` 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=18004.62605.733392.766670@eidolon.muppetlabs.com \
    --to=breadbox@muppetlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox