CPU Registers Flashcards Preview

OSCE > CPU Registers > Flashcards

Flashcards in CPU Registers Deck (21):
1

What are the 8 general purpose registers?

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

2

What is EAX?

The accumulator register.
- addition subtraction
- store the returned value

3

What is EBX?

The Base Register.
- catch all for available storage

4

What is EDX?

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.

5

What is ESI?

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.

6

What is EDI?

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

7

What is ESP?

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.

8

What is EIP?

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).

9

What is a register?

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

10

What is the stack?

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

11

What are the three groups of registers?

General, Control, and Segment

12

What are the general registers divided into?

Data registers, Pointer registers, and index registers

13

What are the four Data registers?

EAX, EBX, ECX, EDX

14

What are the three Pointer registers?

EIP, ESP, EBP

15

What are the two index registers?

ESI, EDI

16

What are control registers used for?

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

What are segment registers?

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

18

What are the three main segments ?

Code, Data, Stack

19

What is the Code Segment?

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

What is the Data Segment?

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

What is the Stack Segment?

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.