Post

Chapter 1 > CPU

In this chapter, we will cover the aspects you need to know about the CPU in order to understand Assembly.

What is CPU?

Basically, the CPU (Central Processing Unit) is the brain of your computer. All tasks and operations performed on your computer are processed by the CPU.

How does the CPU know where to store the information it receives? CPU stores information in its registers and in RAM (Random Access Memory).

You may have heard of 32-bit and 64-bit processors. These refer to CPU architectures, with these numbers defining the size of the CPU’s registers.

RAM (Random Access Memory) is a device that provides temporary storage for both the OS and running programs.

When your computer boots up, the CPU stores the operating system in RAM. Then, every application that you execute is also placed in RAM. We will delve deeper into RAM in the next chapter. For now, let’s focus on the CPU.

Registers

As mentioned, data is stored in the CPU’s registers. Registers serve as storage units for data within the CPU.

There are General Purpose registers (GPRs), Index Registers, Segment Registers, and Pointer Registers.

General-purpose registers

AX, BX, CX, and DX are general-purpose registers. You can store any information in these.

Index registers

SI (Source index) and DI (Destination index) are index registers. They are used for memory addressing.

Segment registers

CS (Code segment), DS (Data segment), SS (Stack segment), and ES (Extra segment) are segment registers. They are used for addressing segments in memory.

Pointer registers

BP (Base pointer) and SP (Stack pointer) are registers used to point to locations of memory where specific data is stored.

You might have a lot of questions by now, but don’t worry! We’ll delve deeper into CPUs and RAM in the next chapters, clearing up any confusion along the way.

Stay tuned for the next chapter! :)

This post is licensed under CC BY 4.0 by the author.

Trending Tags