The difference between the core foundation---at/t assembly and the x86 assembly

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.