Registers and Flags

For a deeper understanding of reverse engineering we need to know the basic functions of the registers and the flags from the register window (right most window in CPU-main thread of Olly).

 Registers


The register in the computer architecture is storage place. A register can hold memory address,  or instructions. These registers are very small and very fast. And these are used in the execution process of the CPU. We are going to learn about the 9 CPU registers in this post.

The nine registers being:

The table above depicts the operations of the 9 CPU registers. 

Flags

The "flags" are one bit of memory present in the processor. Since each flag is only one bit it is either 1 or 0 ("set" or "clear") . There are six flags which are used to indicate the result of certain instructions. A few instructions like "CMP", "TEST", and "JNZ". 

The six flags being:
The table above show the uses of the six flag registers.

Now we a basic understanding of the functionality of the 9 registers and the flags. This understanding will make it easier to understand why the values of the particular flags will be flipped for a particular instruction.  Majorly we will be focusing on three flags C,Z and O flags. 


 

Post a Comment