I have written a small c++ program and then output the instructions as assembly...but I have no clue what it means.
The book I am using does not explain this very well.
Can someone comment the code to tell me what is going on?
I'd greatly appreciate it.
Thanks
.file "CSCILab03-1.cpp"
.text
.align 2
.globl main
.type main, @function
main:
.LFB2:
leal 4(%esp), %ecx
.LCFI0:
andl $-16, %esp
pushl -4(%ecx)
.LCFI1:
pushl %ebp
.LCFI2:
movl %esp, %ebp
.LCFI3:
pushl %ecx
.LCFI4:
subl $16, %esp
.LCFI5:
movw $1, -10(%ebp)
movw $1, -8(%ebp)
movzwl -10(%ebp), %edx
movzwl -8(%ebp), %eax
leal (%edx,%eax), %eax
movw %ax, -6(%ebp)
movl $0, %eax
addl $16, %esp
popl %ecx
popl %ebp
leal -4(%ecx), %esp
ret
.LFE2:
.size main, .-main
.globl __gxx_personality_v0
.ident "GCC: (GNU) 4.1.1 20070105 (Red Hat 4.1.1-52)"
.section .note.GNU-stack,"",@progbits