Registers

When running a program the CPU needs fast access to memory to perform operations efficiently. The time it takes for the CPU to fetch instructions from RAM is a very costly operation which is why we have registers.

The x86 64 bit architecture contains 16 registers each holding 64 bits of data, similarly the older x86 32 bit architecture had 9 registers each holding 32 bits data.

The 32 bit general purpose registers are:

[Read more]

Number Systems

Each base follows a pattern and you can clearly see that from the examples.

Hexadecimal (Base 16)

Each digit can represent upto 16, 0-9 and then A-F(for 10 to 16).

0x2f is 48 in decimal

    2                f
(16^1)*2  + (16^0)*16(f = 16)

Decimal (Base 10)

The one we’re all familiar with, numbers 0-9. Pretty self explanatory.

25 

    2           5
(10^1)*2  + (10^0)*5

Octal (Base 8)

Contains numbers 0-7, each digit representing 3 bits. If you’re familiar with Linux file permissions you already know Octal.

[Read more]