Page 1 of 1

How to correct it?

Posted: Mon Nov 26, 2012 5:37 am
by leetow2003
I push string into stack,I don't want to put it into data section
and then want to display it,but it doesn't display,how to correct it?
Look:

Code: Select all

.text
.global _start
_start:
       pushl %ebp
       movl %esp,%ebp
       pushl $0x48494a00
       movl $4,%eax
       movl $1,%ebx
       movl %ebp,%ecx
       movl $4,%edx
       int $0x80
       popl %eax
       popl %ebp
       movl $1,%eax
       movl $0,%ebx
       int $0x80

Re: How to correct it?

Posted: Mon Nov 26, 2012 8:41 am
by thepowersgang
First answer - Why the ____ would you want to store the string on the stack instead of in .rodata or inline in .text?

Real Answer - You've derped, learn how the stack works then reread your code.