CPU Registers Flashcards

1
Q

What are the 8 general purpose registers?

A

EAX, EBX, ECX, EDX, EDI, ESI, EBP, and ESP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is EAX?

A

The accumulator register.

  • addition subtraction
  • store the returned value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is EBX?

A

The Base Register.

- catch all for available storage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is EDX?

A

The Data Register
It’s often used in mathematical operations like division and multiplication to deal with overflow where the most significant bits would be stored in EDX and the least significant in EAX. It is also commonly used for storing function variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is ESI?

A

The Source Index
The counterpart to EDI, ESI is often used to store the pointer to a read location. For example, if a function is designed to read a string, ESI would hold the pointer to the location of that string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is EDI?

A

The Destination Index
Though it can be (and is) used for general data storage, EDI was primarily designed to store the storage pointers of functions, such as the write address of a string operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is ESP?

A

The Stack Pointer
ESP is used to track the top of the stack. As items are moved to and from the stack ESP increments/decrements accordingly. Of all of the general purpose registers, ESP is rarely/never used for anything other than it’s intended purpose.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is EIP?

A

The Instruction Pointer
Not a general purpose register, but fitting to cover here, EIP points to the memory address of the next instruction to be executed by the CPU. As you’ll see in the coming tutorials, control the value of EIP and you can control the execution flow of the application (to execute code of your choosing).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a register?

A

A register may hold an instruction, a storage address, or any kind of data (such as a bit sequence or individual characters)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the stack?

A

LIFO data structure that lives in RAM. It is an area in program memory that is used for short-term storage of information by the CPU and the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the three groups of registers?

A

General, Control, and Segment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the general registers divided into?

A

Data registers, Pointer registers, and index registers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the four Data registers?

A

EAX, EBX, ECX, EDX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the three Pointer registers?

A

EIP, ESP, EBP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the two index registers?

A

ESI, EDI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are control registers used for?

A

The 32-bit instruction pointer register and the 32-bit flags register combined are considered as the control registers.

Many instructions involve comparisons and mathematical calculations and change the status of the flags and some other conditional instructions test the value of these status flags to take the control flow to other location.

17
Q

What are segment registers?

A

Segments are specific areas defined in a program for containing data, code and stack

18
Q

What are the three main segments ?

A

Code, Data, Stack

19
Q

What is the Code Segment?

A

It contains all the instructions to be executed. A 16-bit Code Segment register or CS register stores the starting address of the code segment

20
Q

What is the Data Segment?

A

It contains data, constants and work areas. A 16-bit Data Segment register or DS register stores the starting address of the data segment.

21
Q

What is the Stack Segment?

A

It contains data and return addresses of procedures or subroutines. It is implemented as a ‘stack’ data structure. The Stack Segment register or SS register stores the starting address of the stack.