explanation of an assembly code
- From: "John" <weekender_ny@xxxxxxxxx>
- Date: 27 Aug 2006 14:09:42 -0700
Can someone explain me what the following assembly code does?
..file "myfile.c"
.def ___main; .scl 2; .type 32; .endef
.text
.align 2
.p2align 4,,15
..globl _main
.def _main; .scl 2; .type 32; .endef
_main:
; why does the program save ebp?
pushl %ebp
; why move 16 in eax?
movl $16, %eax
movl %esp, %ebp
subl $8, %esp
andl $-16, %esp
call __alloca
; where is ___alloca? what are its functions?
call ___main
; where is ___main?
leave
; what does leave do?
xorl %eax, %eax
; does ret automatically return eax?
ret
It was written by gcc for a trivial C program.
Thanks,
--j
.
- Follow-Ups:
- Re: explanation of an assembly code
- From: Rod Pemberton
- Re: explanation of an assembly code
- Prev by Date: Re: Question about jumps
- Next by Date: Re: Question about jumps
- Previous by thread: Question about jumps
- Next by thread: Re: explanation of an assembly code
- Index(es):
Relevant Pages
|