Representation of code #
lnstruction- CPU related-
-
Opcode:操作码 The operations/Opcode/操作码that the CPU can support
-
Operand:操作数/操作数的地址 Also define the method in which Operand are accessed(访问操作数的模式,register /mem/imm)
E 32 R 64
CS 程序
D DATA
S SEGMENT
EBP 当前栈帧基地址
- SS!SEGMENT != FRAME;SS是整个栈‘s
ESP 栈顶指针
EFLAGS 标志
EIP = PC
8086指令集 #
数据 #
MOV
LEA
- LOAD EFFECTIVE ADDRESS
算数 #
CMP 比较操作数
位与逻辑运算 #
字符串处理 #
STOSB STORE BYTE IN STRING
- Prefix: REPxx (Repeat CMPS/MovS/SCAS/STOS )/REPZ
循环分支 #
JMP
- Jxx(条件跳转):JE/NE/…
- SEGMENT ERROR IF INVALID ADDRESS
CALL
- JMP + SAVE CONTEXT
RET
- JMP + POP ADDRESS
INT
CPU控制类 #
汇编 #
Types of Statements in Assembly Language-
-
1.Executable Instructions (可执行指令) Generate machine code for the processor to execute at runtime. Instructions tell the processor what to do
-
2.Macros(宏指令) Translated by the assembler into real instructions. Simplify the programmer task
-
3.Assembler Directives(伪指令) Provide information to the assembler while translating a program. Used to define segments, allocate memory variables, etc. Non-executable: directives are not part of the instruction set