Zhou Yuyong Original works reproduced please specify the source
"Linux kernel Analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000
Disassemble the C code into assembly code, and then analyze how the computer worksThe following is a simplified assembly code for C code C code compiled into assembler code
1 g:2 PUSHL%EBP3 movl%esp,%EBP4Movl8(%EBP),%eax5Addl $6,%eax6 popl%EBP7 ret8 F:9 PUSHL%EBPTen movl%esp,%EBP OneSUBL $4,%esp AMovl8(%EBP),%eax - movl%eax, (%ESP) - Pagerg the Leave - ret - Main: - PUSHL%EBP + movl%esp,%EBP -SUBL $4,%esp +MOVL $4, (%ESP) A PagerF atAddl $2,%eax - Leave - ret
Analysis of stack changes during the working process of assembly code
Summary: The EIP tells the CPU which instruction to execute, and by executing a specific sequence of instructions, the computer can do the specific calculation work
Analyze assembly code to understand how a computer works