Registers Flashcards

Details about general purpose registers.

1
Q

EAX - The Accumulator Register

A

Primary register for storing common calculations (add, sub). Given preference for calcs by assigning it more efficient one-byte OP codes. Used to store a function’s return value.

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

EBX - The Base Register

A

Doesn’t really have a special purpose. Used as a catch-all for available storage.

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

ECX - The Counter Register

A

Used as a loop or function repetition counter.

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

EDX - The Data Register

A

Like a partner register with EAX. Often used in math operations (mul, div) to deal with the overflow, with the most significant bits stored in EDX and the least in EAX.

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

ESI - The Source Index

A

The counterpart to EDI. Often used to store the pointer to a read location. For ex. if a function reads a string, ESI would hold the pointer to the location of that string. Can only reference either the whole register by name, or the lower 16 bits with ‘SI’.

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

EDI - The Destination Index

A

Was primarily designed to store the storage pointer of functions, such as the write address of a string operation. Also used for general data storage. Can only reference either the whole register by name, or the lower 16 bits with ‘DI’.

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

EBP - The Base Pointer

A

Used to keep track of the base/bottom of the stack. Often used to reference variables on the stack with an offset to the current value of EBP. Can only reference either the whole register by name, or the lower 16 bits with ‘BP’.

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

ESP - The Stack Pointer

A

Tracks the top of the stack. As items are pushed and popped from the stack, ESP increments/decrements accordingly. Rarely used for anything other than this. Can only reference either the whole register by name, or the lower 16 bits with ‘SP’.

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

EIP - The Instruction Pointer

A

Points to the memory address of the next CPU instruction. Not among the general-purpose registers.

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