I was looking at some ASM code for some of my programs using the 'gcc -S' option to generate it and I noticed a few things that I have NO IDEA what they do, why they are there and if they have any effect on my programs.
Here is a list:
Any help would be appreciated, im not too concerned about the last two commands but more or less the aligns, what are they, and are they important, I would imagine they are relatively significant because they are there to begin with.
;at the begining
.p2align 2 ;what's this?!
;and I used to know what these were but I forgot
leave ;I think this does popl %ebp to get the original base pointer
ret ;and does this jump to where the program was called or after it or what, I forgot...
And another question in ASM:
I can't seem to figure out why I continually get a seg-fault for this prog:
Any explanations of just how things work at all could help, thanks.
.string "Hello, World!\n"
movl %esp, %ebp
movl $10, %ebx
cmpl $0, %ebx
movl $0, %eax