Learning notes of ssembly language

As a kind of programming languages, assembly language is intermediate between higher-level languages that cannot be recognized by a machine and machine code instructions that are not friendly for human reading. Therefore it is very helpful for us to understand the underlying mechanism of computer programs.

I. Basic concepts

I.1 Modern CPU architecture



The modern CPU architecture is a mixture of classic Von Neumann computer architecture and Harvard computer architecture, generally composed of control unit(CU), arithmetic logic unit(ALU), registers, three levels of caches, memory management unit(MMU) etc. Instruction and input data, initially stayed in memory, are read into CPU through bus. They are then processed by CU and ALU in a streamline way. The result data will also be stored in registers or caches, then reused or waiting a proper time to write into memory.

I.2 Registers

Registers play a vital role in CPU as they store temporary data during instruction execution and some of those have special functionalities which are neccssary for CPU processing. Their store size is kept equal to ALU/CU input and output size in one time(i.e. on 32-bit CPU, register size shall be 32-bit). For example, program counter(PC) is a special register that always stores the address of the next instruction to be executed from memory. so some people like to category it inside CU. Common registers are variables in Assembly language.

I.3 Addressing modes

DOS Assembly

Debug Tool

R: look and change register’s value

Design Patterns —— MVC 2022-May-11th-Design-patterns-Strategy

Comments

You forgot to set the shortname for Disqus. Please set it in _config.yml.
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×