The differences between assembly and disassembly

Source: Internet
Author: User

Write the following code under the Linux system:

by directive: Gcc-s MAIN.C will generate the Main.s file as a compilation file (as I have mentioned in the previous blog post).

by directive: Gcc-c main.c Generate MAIN.O (binary)

Again by command: objdump-d MAIN.O Generate disassembly

Disassembly is a sequence of bytes in a machine-code-based file to determine the code of the Assembly.

The left is the byte sequence value, and the right is the disassembly code.

The above comparison can draw the following conclusions;

1, from the code to see the assembly and disassembly instructions basically the same.

2. The immediate number of the assembly operation is decimal, and the immediate number of the two disassembly operations is hexadecimal (that is, a value of the left sequence).

3, assembly and disassembly operation (Register or memory) address is also different.


In fact, I understand that, do not know right.

Everyone has eaten meat, right? Compilation and disassembly are the relationship between pigs and meat. Self-understanding. I don't know, right. Hope to correct me.

The differences between assembly and disassembly

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: 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.