Here is a very simple c/c++ program and its assembly program compiled using flag -S.
There are no headers included.
int main(){ return 0; }
Following is the output generated.
This output shows an anatomy of an
; represents sections in the program like .bss section, .text section etc. .file "simple.cpp" .text .globl main .type main, @function ; entry to main function main: ; push the current value of each should be pushed onto the stack to be restored at the end pushq %rbp ; move the contents of stack pointer to rbp register. movq %rsp, %rbp ; push the exit code 0 to the eax register. movl $0, %eax ; pop the contents of rbp register. popq %rbp ; return from the program. ret