P
Paul
It's still a text segment, does't matter if it's mapped through
descriptor, page or something else.
What is still a text segment?
All memory and everything that ever existed in the universe, is a text
segment?
It's still a text segment, does't matter if it's mapped through
descriptor, page or something else.
What is still a text segment?
All memory and everything that ever existed in the universe, is a text
segment?
.data and .text are both directives to the assembler. .data tells the
assembler that the upcoming section is considered data. .text tells
the assembler that the upcoming section is considered assembly
language instructions.
What's your problem with this? Something that you don't understand?
My problem is that you are talking complete and utter shite.
A NON SEGMENTED MEMORY MODEL DOES NOT HAVE A TEXT
SEGMENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!
please get this into your thick skull and stop copying the idiot Leigh.
My problem is that you are talking complete and utter shite.
A NON SEGMENTED MEMORY MODEL DOES NOT HAVE A TEXT
SEGMENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!
please get this into your thick skull and stop copying the idiot Leigh.
"hanukas" <[email protected]> wrote in messageMy problem is that you are talking complete and utter shite.A NON SEGMENTED MEMORY MODEL DOES NOT HAVE A TEXT
SEGMENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!
please get this into your thick skull and stop copying the idiot Leigh.
Text segment is a segment of source code which contains assembly
language instructions.
.section .text
.global main
main:
ldr r1, [r0]
ldr r1, [r0, #3]
The stuff after ".section .text" is TEXT SEGMENT (in the source code).
It just means that code is placed here, it has nothing to do with x86
and segmentffset addressing with selectors or memory models.
You are thinking in terms of Instruction Pointer being in cs:ip on 16
bit realmode x86 programs, am I on the right track? I have bad news
for you: this is not relevant and your argument above is therefore
invalid.
You are arguing about something that I am not. You were arguing about
this with Leigh long before, am I about right? The thing is.. text
segment is just another way to say: "assembly instructions go here"
for the assembly compiler. You keep insisting that some specific
memory model (!) is required. You're just wrong. It's alright, I make
mistakes all the times too and move along.
It's called learning, it's a great thing, not a bad thing.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Shut up you fool. You don't have a clue what you are talking about. I can't
be arsed indenting all that shite and spending time to reply to someone who
is obviously a complete and utter idiot.
"hanukas" <[email protected]> wrote in messageMy problem is that you are talking complete and utter shite.A NON SEGMENTED MEMORY MODEL DOES NOT HAVE A TEXT
SEGMENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!
please get this into your thick skull and stop copying the idiot Leigh.
Text segment is a segment of source code which contains assembly
language instructions.
.section .text
.global main
main:
ldr r1, [r0]
ldr r1, [r0, #3]
The stuff after ".section .text" is TEXT SEGMENT (in the source code).
It just means that code is placed here, it has nothing to do with x86
and segmentffset addressing with selectors or memory models.
You are thinking in terms of Instruction Pointer being in cs:ip on 16
bit realmode x86 programs, am I on the right track? I have bad news
for you: this is not relevant and your argument above is therefore
invalid.
You are arguing about something that I am not. You were arguing about
this with Leigh long before, am I about right? The thing is.. text
segment is just another way to say: "assembly instructions go here"
for the assembly compiler. You keep insisting that some specific
memory model (!) is required. You're just wrong. It's alright, I make
mistakes all the times too and move along.
It's called learning, it's a great thing, not a bad thing.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Shut up you fool. You don't have a clue what you are talking about. I
can't
be arsed indenting all that shite and spending time to reply to someone
who
is obviously a complete and utter idiot.
[...]
.data and .text are both directives to the assembler.
.data tells the
assembler that the upcoming section is considered data. .text tells
the assembler that the upcoming section is considered assembly
language instructions.
[...]
A NON SEGMENTED MEMORY MODEL DOES NOT HAVE A TEXT
SEGMENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I disagree with some of this but agree with other parts.James Kanze said:[...]
A NON SEGMENTED MEMORY MODEL DOES NOT HAVE A TEXT
SEGMENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
There are segments, and there are segments. Any modern linker
will understand segments, in order to give you more control of
where things are placed in memory. This has nothing to do with
how the hardware addresses things---both under Windows and under
Linux, the linker will merge several (usually all) logical
segments into a single hardware "segment".
On Mar 8, 3:50 pm, "Paul" <[email protected]> wrote:
[...]
.data and .text are both directives to the assembler.
Which assembler? Most of the assemblers I've used didn't have
such directives.
I've never seen an assembler that worked that way,
and I can't imagine what one would achieve doing it. With the assemblers
I've seen that did support .data and .text, these directives
issued entries in the object file which told the linker to put
them in read-write or in read-only memory.
In practice today, any decent linker will support a large number
of segments, both in read-write and in read-only memory. After
all, you don't want the tables for exception stack walkback to
be in the same page as your code, just because they're both
read-only and were compiled in the same translation unit.
hanukas said:[...]
.data and .text are both directives to the assembler.
Which assembler? Most of the assemblers I've used didn't have
such directives.
Most of the assemblers I have used do have such directives:
GNU Assembler, .section .text
NASM, SECTION .text
MASM, .CODE
TASM, CODESEG
So?
I've never seen an assembler that worked that way,
Worked what way? You generally want to put data into the data segment
and code into the text aka. code segment. These directives allow the
programmer to do this, what's the problem?
This seems to be a simplification to me.
(to avoid the word segment, which seems to call for other associations).
Partitions can have attributes, like read-only vs. read/write, executable, shareable, etc.
For example:
Compile time constants can be put in read-only non-executable shared partitions,
which are often refered to as "text".
Code can be stored in read-only executable shared partitions.
Variables can be stored in read/write non-executable non-shared partitions.
System wide global variables can be stored in read/write non-executable shared partitions.
The linker/loader lays out the memory by gathering partitions which compatible attributes.
Not all hardware support all attributes.
But it is not true that in general code is identical to text,
in particular for platforms where there is a difference between executable and non-executable partitions of memory.
This seems to be a simplification to me.
Often there are more than two "partitions"
(to avoid the word segment, which seems to call for other associations).
[...]On Mar 8, 3:50 pm, "Paul" <[email protected]> wrote:Which assembler? Most of the assemblers I've used didn't have.data and .text are both directives to the assembler.
such directives.
Most of the assemblers I have used do have such directives:
GNU Assembler, .section .text
NASM, SECTION .text
MASM, .CODE
TASM, CODESEG
Worked what way? You generally want to put data into the data segment
and code into the text aka. code segment. These directives allow the
programmer to do this, what's the problem?
[...]"hanukas" <[email protected]> wrote in messageThere are segments, and there are segments. Any modern linker willA NON SEGMENTED MEMORY MODEL DOES NOT HAVE A TEXT
SEGMENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
understand segments, in order to give you more control of where
things are placed in memory. This has nothing to do with how the
hardware addresses things---both under Windows and under Linux, the
linker will merge several (usually all) logical segments into a
single hardware "segment".
I disagree with some of this but agree with other parts.
<Wintel specific>
A flat memory model , is mapped with a virtual segmented memory model.
The CS, DS,SS registers will be initialised to the appropriated segments.
each segment will have access privileges.
The hardware can then use segment-offset addressing.
</Wintel specific>
Yes all segments exist in the same flat memory but they have different
access priviledge in a virtual address space..
In a plain flat model there is no segments and no access priviledges.
Its all interrelated with program format , hardware, OS etc etc.
Please don't invent a new name -- it's known as a "segment" in all
linking environments I've seen, from the Amiga to Texas Instruments to
Unix ...
Most of the assemblers I have used do have such directives:[...]
.data and .text are both directives to the assembler.
Which assembler? Most of the assemblers I've used didn't have
such directives.
GNU Assembler, .section .text
The directive here is .section. The .text is simply a symbol; you
can,
at least in principle, use anything you want (and a really good
compiler
will use more than just .text and .data).
NASM, SECTION .text
Ditto. The directive is SECTION; the .text is just a user defined
symbol.
MASM, .CODE
TASM, CODESEG
Worked what way? You generally want to put data into the data segment
and code into the text aka. code segment. These directives allow the
programmer to do this, what's the problem?
The directives allow the programmer to divide the program up into one
or
more segments. Other directives tell the linker where to put these
segments. There may be defaults for some symbols, but they're
certainly
not universal, and they don't mean that you cannot use other segments,
or other names.
I disagree with some of this but agree with other parts.[...]
A NON SEGMENTED MEMORY MODEL DOES NOT HAVE A TEXT
SEGMENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
There are segments, and there are segments. Any modern linker will
understand segments, in order to give you more control of where
things are placed in memory. This has nothing to do with how the
hardware addresses things---both under Windows and under Linux, the
linker will merge several (usually all) logical segments into a
single hardware "segment".
<Wintel specific>
A flat memory model , is mapped with a virtual segmented memory model.
The CS, DS,SS registers will be initialised to the appropriated segments.
each segment will have access privileges.
The hardware can then use segment-offset addressing.
</Wintel specific>
There's nothing Wintel specific about the segments defined by the
Sparc
assembler, and managed by the Sparc linker. The segments, in this
case,
disappear once the executable is loaded.
Yes all segments exist in the same flat memory but they have different
access priviledge in a virtual address space..
In a plain flat model there is no segments and no access priviledges.
I've yet to see an assembler/linker that didn't support some form of
segments, and most of my experience is on machines with a flat memory
model.
Its all interrelated with program format , hardware, OS etc etc.
Obviously, you didn't read what you are responding to, or you didn't
understand it.
Yes I read what you wrote re:James Kanze said:"James Kanze" <[email protected]> wrote in message[...]
A NON SEGMENTED MEMORY MODEL DOES NOT HAVE A TEXT
SEGMENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
There are segments, and there are segments. Any modern linker will
understand segments, in order to give you more control of where
things are placed in memory. This has nothing to do with how the
hardware addresses things---both under Windows and under Linux, the
linker will merge several (usually all) logical segments into a
single hardware "segment".I disagree with some of this but agree with other parts.<Wintel specific>
A flat memory model , is mapped with a virtual segmented memory model.
The CS, DS,SS registers will be initialised to the appropriated segments.
each segment will have access privileges.
The hardware can then use segment-offset addressing.
</Wintel specific>
There's nothing Wintel specific about the segments defined by the
Sparc
assembler, and managed by the Sparc linker. The segments, in this
case,
disappear once the executable is loaded.
Yes all segments exist in the same flat memory but they have different
access priviledge in a virtual address space..
In a plain flat model there is no segments and no access priviledges.
I've yet to see an assembler/linker that didn't support some form of
segments, and most of my experience is on machines with a flat memory
model.
Its all interrelated with program format , hardware, OS etc etc.
Obviously, you didn't read what you are responding to, or you didn't
understand it.
The word segment has two different technical meanings.
One refers to the hardware implementation used by Intel. The other,
older, refers to the logical organization of the generated code into
different segments, which the linker manages separately.
Yes here is one I use today:I dealt with
segments long before the 8086 appeared, on machines with flat
addressing
and no memory protection.
--
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.