Several Questions
Before getting to the main topic, let me ask a few questions:
What is the English abbreviation that represents the function of instructions in local code?
What does segment definition refer to in assembly language programs?
In fact, everyone may have different answers; there is no need to strictly adhere to standard answers, understanding is sufficient.
Mnemonic
A collection of commands and data that make up a program
Assembly Code
If you directly open local code, you can only see a list of values. This leads to the idea of attaching English word abbreviations that represent their functions to various local codes. For example, adding ‘add’ (abbreviation for addition) to the local code for addition operations, and ‘cmp’ (abbreviation for compare) to the local code for comparison operations, etc. These abbreviations are called mnemonics, and programming languages that use mnemonics are called assembly languages.

The source code of assembly language corresponds one-to-one with local code.
Pseudoinstructions
The source code of assembly language consists of instructions (which will be discussed later as opcodes) that are converted into local code and pseudoinstructions for the assembler. Pseudoinstructions are responsible for indicating the structure of the program and the method of assembly to the assembler (the conversion program).
Syntax
In assembly language, one line represents one instruction to the CPU. The syntax structure of assembly language instructions is opcode + operand.
|
Opcode |
Operand |
Function |
|---|---|---|
|
mov |
A, B |
Assign the value of B to A |
|
and |
A, B |
Add the value of A and B, and assign the result to A |
|
push |
A |
Store the value of A in the stack |
|
pop |
A |
Read the value from the stack and assign it to A |
|
call |
A |
Call function A |
|
ret |
None |
Return processing to the source of the function call |
The local code can only run after being loaded into memory. Memory stores the instructions and data that make up the local code. During program execution, the CPU reads the instructions and data from memory and then stores them in the CPU’s internal registers for processing.

The relationship between the CPU and memory
In fact, registers not only have the function of storing instructions and data but also have computational functions, as shown in the table below:
|
Register Name |
Name |
Function |
|
eax |
Accumulator Register |
Computation |
|
ebx |
Base Register |
Store memory address |
|
ecx |
Count Register |
Count loop iterations |
|
edx |
Data Counter |
Store data |
|
esi |
Source Index Register |
Store memory address of the data sending source |
|
edi |
Destination Index Register |
Store memory address of the data sending destination |
|
ebp |
Extended Base Pointer Register |
Store memory address of the data storage base point |
|
esp |
Extended Stack Pointer Register |
Store memory address of the highest data in the stack |
This article is a summary based on my self-learning experience. If you have any suggestions or opinions, please leave a comment at the end. Thank you.