How to correct it?

Programming, for all ages and all languages.
Post Reply
leetow2003
Member
Member
Posts: 70
Joined: Fri Nov 19, 2010 6:54 pm

How to correct it?

Post 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
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: How to correct it?

Post 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.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Post Reply