computer System Compilation---IA32 processor data format and data manipulation
IA32 Data format:
Intel uses the term "word" to denote a 16-bit data type, so the 32-digit number is called "Double word", and the 64-digit number is "four words".
char* This refers to all pointer types, note that the newly added long long for C language is eight bytes, but the hardware IA32 does not support this type.
Register (8 32-bit registers, all starting with%e)
%eax,%ECX,%edx: The caller holds the (data) register, and the process p call Q,q can overwrite the registers, but the data in P is not changed.
%EBX,%esi,%edi: The callee saves (data) registers, and when the scene p call Q,q must overwrite these register data, to save them to the stack,
and restore them at the end of the call, these data p or other procedures require them.
%esp,%EBP: About the stack pointer
Most directives have one or more operands that indicate the value of the source data to be referenced in the execution of an operation, as well as the target location of the placement result. The source data values can be given as constants or read from registers or memory, and the results can be stored in registers or memory.
There are three types of operations:
>>>1. The immediate number is the constant, starting with $, followed by an integer representation;
>>>2. The number of registers, which represents the saved value in a register for a word operation, and one of 8 single-byte registers for byte operations, such as:%al (low 8-bit in the EAX register)
>>>3. Memory reference, which accesses a location of memory based on the calculated valid address, including four parts: Immediate number offset (LMM), base register Eb, variable address register Ei, scale factor S. Valid address is calculated as IMM + R[eb] + r[ei] * s. (R[eb] Represents the value of the register Eb, R[ei] represents the value of the register Ei, the value of S can only be 1,2,4 or 8) the MB[ADDR in the following table represents a reference to the B-byte value of memory in memory starting from address addr.
About the Operand format table
For example: The value of address 0x100 is 56, then the value of the operand 0x100 is 56, which is the absolute addressing, the $0x100 value 0x100, is the immediate number addressing;
Computer system compilation---IA32 processor data format and data manipulation