1, in-depth Linux kernel premise
Because I have learned the x86 assembly language of Intel before, so this article does not tell the basic grammar of the Assembly;
Kernel Most of the code is implemented in C and assembly language, to understand the kernel, C language Most people have mastered, the next step is to master the assembly knowledge, in order to understand the Linux kernel knowledge!!!
2, learn the Linux kernel line
First, the kernel has a basic part and in-depth part, I think it should be from a global perspective to understand the Linux kernel, so that we achieve a deeper understanding, from the core of the overall architecture---> Kernel source Interpretation, and in this process constantly to modify the code, programming debugging is crucial!!!
3, the difference between the at-and-T Assembly
(1), register reference
In the format of the AT/T assembly, the front of the register should be added:%,%eax;
(2), the order of the operands
mov%eax (source),%EBX (Purpose)
(3), constant/immediate number format
Use the immediate number to add $to the front of the number, MOV $4;
(4), the length of the operand
The length of the operand is represented by the symbol that is added to the instruction
b (Byte), W (word), L (Long), movw %ax,%BX;
(5), transfer instructions
Ljump and Lcall, in Intel format: JMP far and call far;
(6), addressing mode
The offset was moved to the front,
4. Embedded in C language--embedded assembly
_asm_ represents the statement of the embedded assembly;
A, B, C, d respectively represent registers eax, EBX, ecx, edx;
S, D represents register ESI EDI;
R denotes any register;
Read the kernel code may appear embedded assembly statements, the firm grasp of!!!
This article is from the "wait0804" blog, make sure to keep this source http://wait0804.blog.51cto.com/11586096/1885420
The difference between the core foundation---at/t assembly and the x86 assembly