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