From: Alex <pppsss7@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: some questions about gcc4
Date: Tue, 23 Feb 2010 15:55:00 -0000 [thread overview]
Message-ID: <1266940130.2507.4.camel@localhost.localdomain> (raw)
Hello.
I need some hints. I have compiled simple source:
(gdb) list
1 void main (void) {
2 int i;
3 i = 1;
4 }
And disassembling this code is:
Dump of assembler code for function main:
0x08048394 <main+0>: push ebp
0x08048395 <main+1>: mov ebp,esp
0x08048397 <main+3>: sub esp,0x10
0x0804839a <main+6>: mov DWORD PTR [ebp-0x4],0x1
0x080483a1 <main+13>: leave
0x080483a2 <main+14>: ret
End of assembler dump.
I have only 1 int variable. My system is 32Bit. But why for 1 int
variable compiler make sub esp,0x10 ?
1 int variable located in 4 bytes. What in another 12 ?
next reply other threads:[~2010-02-23 15:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-23 15:55 Alex [this message]
2010-02-23 16:19 ` Cedric Roux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1266940130.2507.4.camel@localhost.localdomain \
--to=pppsss7@gmail.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).