整理了一下51单片机的指令,有的时候感觉这些指令集还是看英文文档比较好,毕竟指令源于英语。大致整理了一下,做的不好大家别介意。
标准51指令
数据传送类指令
MOV | move | 传送 |
MOVC | move code | 访问常数表(查表指令) |
MOVX | move extemel RAM | 访问外部RAM |
PUSH | push xx onto stack | 堆栈压入 |
POP | pop xx from stack | 出栈操作 |
XCH | exchange | 与ACC字节数据交换 |
XCHD | exchange lowerder digit | 间址操作数低半字节与ACC低半字节内容互换 |
SWAP | swap nibbles within the Accumulator | 累加器高低四位互换 |
算数运算类指令
ADD | add | 不带进位加法 |
ADDC | add xxx to Accumulator | 带进位加法 |
SUBB | subtract xx from ACC with CARRY | 带借位减法 |
DA | decimal adjust | 十进制调整 |
MUL | multiply | 乘法 |
DIV | divide | 除法 |
DEC | decrement | 减一操作 |
INC | increment | 加一操作 |
逻辑运算与循环类指令
ANL | and xx to Accumulator | 逻辑与 |
ORL | or xx to Accumulator | 逻辑或 |
XRL | exclusive-or xx to Accumulator | 逻辑异或 |
CLR | clear | 清零 |
CPL | complement | 取反 |
RR | rotate Accumulator right | 循环右移 |
RRC | rotate Accumulator right through the CARRY | 带进位符循环右移 |
RL | rotate Accumulator left | 循环左移 |
RLC | rotate Accumulatorleft through the CARRY | 带进位符循环左移 |
控制转移类指令
AJMP | absolute jump | 短跳转(范围不超过2k) |
LJMP | long jump | 长跳转(64K范围) |
SJMP | short jump | 相对跳转(-128~127字节) |
JMP | jump indirect relative to the DPTR | 散转移 |
JZ | jump if Accumulator is zero | 判断0转移 |
JNZ | jump if Accumulator is notzero | 判断非0转移 |
CJNE | compare xx to ACC and jump if not equal | 比较不相等转移 |
DJNE | decrement direct byte and jump if not zero | 减一不为0转移 |
ACALL | absolute subroutine call | 绝对调用(范围不超过2k) |
LCALL | longsubroutine call | 长调用(64k范围) |
RET | return fromsubroutine | 返回下一条指令处 |
RETI | return form interrupt | 返回自中断至下一条指令处 |
NOP | no operation | 空操作 |
位判断操作指令
JC | jump if carry is set | 判断CY为1时,跳转 |
JNC | jump if carry not set | 判断CY为0时,跳转 |
JB | jump if direct Bit is set | 判断某位BIT为1时,跳转 |
JBC | jump if direct Bit is set & clear | 判断某位BIT为1时,跳转并定位清0 |
JNB | jump if direct Bit is not set | 判断某位BIT为0时,跳转 |