Re: Question about jumps



Markus Pitha wrote:
Am Sun, 27 Aug 2006 12:49:37 +0200 schrieb Herbert Kleebauer:
Markus Pitha wrote:


segment .data

Is your program (and not only the data) really stored and executed
in the data segment? Which assembler sets the data segment executable?

No, it was my mistake. The program is stored in the .text segment. I just
wanted to delete all the unnecessary code and obviously I deleted too
much.

There is no need to put read only data in the data segment,
it is best placed in the code segment.


successmsg db "eax is set to 1.", 0, 10
^
Which purpose has the 0?

0 terminates the string and 10 is a newline, isn't it?

C uses NULL terminated strings, bur we are in assembly (and
here we decide ourselves how to terminate an string). Redirect
the output to a file and look at the hex dump of the file,
then you will see, the 0 is written as part of the string
to stdout.
.



Relevant Pages

  • Re: Is it possible sentence?
    ... >>I have a question regarding to string variable. ... then it's probably in the data segment. ... since it ceases to be strictly conforming ... processor can do to it in normal execution. ...
    (comp.lang.c)
  • Re: Another dynamic memory doubt
    ... jacob navia wrote: ... but rather makes ptr point to the start of a string ... All C implementations have a data segment. ...
    (comp.lang.c)
  • Re: Question about jumps
    ... Frank already gave you the answer, ... Which assembler sets the data segment executable? ... terminates the string and 10 is a newline, ...
    (alt.lang.asm)