In assembly languages, what do eax, EBX, ECx, EDX, ESI, EDI, EBP, and ESP mean?

Source: Internet
Author: User
Tags integer division

Eax, EBX, ECx, EDX, ESI, EDI, EBP, ESP, etc. are the names of General registers on the CPU in x86 assembly language, and are 32-bit registers. These registers can be viewed as variables in C language.

For example:Add eax,-2;// It can be considered that a value such as-2 is added to the variable eax.

These 32-bit registers have multiple purposes, but each of them has "expertise" and has its own special features.

EaxIt is an accumulator, which is the default register of many addition multiplication commands.

EBXIt is a base register that stores the base address in memory addressing.

ECXIs the counter, is the counter of the repeated (REP) prefix command and loop command.

EdXIt is always used to place the remainder produced by integer division.

ESI/EDI is called" source/destination index register "(source/destination index), because in many string operation commands, DS: ESI refers to the source string, ES: EDI points to the target string.

EBPIs the base pointer, which is most often used as the frame pointer for calling high-level language functions ). when cracking, you can often see the starting point of a standard function.Code:

Push EBP;Save current EBP
MoV EBP, esp;Set EBP as the current stack pointer
Sub ESP, xxx;Reserve XXX bytes for function temporary variables.
...

In this way, EBP forms a framework of this function. The EBP is above the original EBP, And the return address and parameter. EBP are under temporary variables.MoV ESP, EBP/pop EBP/RETYou can.

ESPSpecifically used as a stack pointer, It is vividly called a stack top pointer. The top of the stack is a region with a small address. The more data pushed into the stack, the smaller the ESP. On a 32-bit platform, ESP is reduced by 4 bytes each time.

 

Part 2 registers:

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.