基础汇编指令

寄存器

本文中使用的寄存器通常为 ra, rb, rc, rd。

mov 指令

mov dst, src

一些例子:

# Moves the content of register rb into ra
mov ra, rb
# Moves the immediate 35h into ra
mov ra, 35h
# Moves the data at memory location ra into register rd
mov rd, [ra]
# Moves the data at memory location 12h into register rd
mov rd, [12h]
# Moves the content of register rc to the memory location rb.
mov [rb], rc
# Moves the immediate 07h to the memory location rb.
mov [rb], 07h

ALU 指令

instruction dst, src

dst 作为第一个操作数,src 作为第二个操作数,将运算结果存在 dst 中。

CMP 指令

cmp rn, rm
cmp rn, i

JUMP 指令

jxxx src

点此查看原文