Re: Linux asm code
- From: Andrei Voropaev <spamtrap@xxxxxxxxxx>
- Date: Fri, 30 Sep 2005 19:15:45 +0000 (UTC)
spamtrap@xxxxxxxxxx wrote:
> I have compiled a useless C module with Gcc under Linux just to see
> what compiled C code looks like. The C code is this:
>
> print1(char * str)
> {
> printf(str);
> }
>
> The output asm code is as follows (generated by objdump)
Compilers have their own logic. They may want specific alignment for the
stack variable, or some other things in "mind". I've seen even more
intrigueing things, like when you request 3 bytes array, on the stack
will be 24 bytes, but if you request 8 bytes array, you get exactly 8
bytes on the stack. Go figure.
After all it's not assembler, but C that you use. So if such things
bother you, then switch to assembler :)
--
Minds, like parachutes, function best when open
.
- References:
- Linux asm code
- From: spamtrap
- Linux asm code
- Prev by Date: Re: From NASM to Visusal Studio source debugging
- Next by Date: Re: Figuring out table based encryption in assembly
- Previous by thread: Linux asm code
- Next by thread: Accessing Debug Registers in Linux
- Index(es):