Computer system compilation---IA32 processor data format and data manipulation

Source: Internet
Author: User

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

Related Article

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.