Re: Question about jumps
- From: Frank Kotler <fbkotler@xxxxxxxxxxx>
- Date: Sun, 27 Aug 2006 07:14:43 -0400
Markus Pitha wrote:
Hello,
Frank Kotler wrote:
"suclen" includes both strings. Try it like this:
successmsg db "eax is set to 1.", 0, 10
succlen equ $-successmsg
errmsg db "eax is not 1.", 0, 10
errlen equ $-errmsg
You were right, but now I'm totally confused. What has the definition
order to do with the program execution?
Nothing. Your program is executing fine - it isn't skipping back and printing the "else: section at all. It isn't a question of what order, but how you're defining the length of the string. The "$ - msg" expression needs to immediately follow what it's calculating the length of. The "write" function does *not* terminate on a zero - that's more of a "C thing" - but writes the full length you say - whatever it might be.
If it *did* terminate on the zero, you wouldn't get the linefeed (10). And yeah, you need that "section .text". Herbert doesn't miss much!
Best,
Frank
.
- Follow-Ups:
- Re: Question about jumps
- From: Markus Pitha
- Re: Question about jumps
- References:
- Question about jumps
- From: Markus Pitha
- Re: Question about jumps
- From: Frank Kotler
- Re: Question about jumps
- From: Markus Pitha
- Question about jumps
- Prev by Date: Re: Question about jumps
- Next by Date: Re: Question about jumps
- Previous by thread: Re: Question about jumps
- Next by thread: Re: Question about jumps
- Index(es):
Relevant Pages
|