跳过正文

系编-Representation of code

·164 字· loading · loading ·
Masterlong
作者
Masterlong
熬夜,但是世界之夜
目录
系统级编程 - 这篇文章属于一个选集。
§ 2: 本文

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)

img

img

E 32 R 64

CS 程序

D DATA

S SEGMENT

EBP 当前栈帧基地址

  • SS!SEGMENT != FRAME;SS是整个栈‘s

ESP 栈顶指针

EFLAGS 标志

EIP = PC

img

img

8086指令集
#

数据
#

MOV

LEA

  • LOAD EFFECTIVE ADDRESS

算数
#

CMP 比较操作数

位与逻辑运算
#

字符串处理
#

STOSB STORE BYTE IN STRING

  • Prefix: REPxx (Repeat CMPS/MovS/SCAS/STOS )/REPZ

img

循环分支
#

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

系统级编程 - 这篇文章属于一个选集。
§ 2: 本文

相关文章

系编-intro
·53 字· loading · loading
图形学-2
·127 字· loading · loading
为‘夹洋文’做一丢丢辩护
·5 字· loading · loading