PIRATEZGW Original works reproduced please specify the source "Linux kernel Analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000
In fact, this is to deal with the work of the MOOC course, where the environment can not contact the Internet at any time, so submitted are relatively late, nonsense not much to say, into the topic.
First, the operation of the experiment
This is mainly in the Linux environment using VI + GCC to write C program code, and then compiled into assembly code, as shown in
Second, code Analysis
Because of the dynamic linkage of the original assembly code and the symbol table is not removed, so remove them and get the Pure assembly code:
G:pushl%ebpmovl%esp,%ebpmovl8 (%EBP),%eaxaddl$2,%eaxpopl%ebpretf:pushl%ebpmovl%esp,%ebpsubl$4,%espmovl8 (%EBP),% Eaxmovl%eax, (%ESP) Callgleaveretmain:pushl%ebpmovl%esp,%ebpsubl$4,%espmovl$9, (%ESP) callfaddl$1,%eaxleaveret
Now from the register point of view,
"Linux kernel Analysis" MOOC course on how computers work from the assembly language perspective