当前位置:文档之家› 51单片机汇编指令

51单片机汇编指令

按功能分为五大类:(1)数据传送类指令(7种助记符)MOV(Move)对内部数据寄存器RAM和特殊功能寄存器SFR的数据进行传送;MOVC(Move Code)读取程序存储器数据表格的数据传送;MOVX (Move External RAM) 对外部RAM的数据传送;XCH (Exchange) 字节交换;XCHD (Exchange low-order Digit) 低半字节交换;PUSH (Push onto Stack) 入栈;POP (Pop from Stack) 出栈;(2)算术运算类指令(8种助记符)ADD(Addition) 加法;ADDC(Add with Carry) 带进位加法;SUBB(Subtract with Borrow) 带借位减法;DA(Decimal Adjust) 十进制调整;INC(Increment) 加1;DEC(Decrement) 减1;MUL(Multiplication、Multiply) 乘法;DIV(Division、Divide) 除法;(3)逻辑运算类指令(10种助记符)ANL(AND Logic) 逻辑与;ORL(OR Logic) 逻辑或;XRL(Exclusive-OR Logic) 逻辑异或;CLR(Clear) 清零;CPL(Complement) 取反;RL(Rotate left) 循环左移;RLC(Rotate Left throught the Carry flag) 带进位循环左移;RR(Rotate Right) 循环右移;RRC (Rotate Right throught the Carry flag) 带进位循环右移;SWAP (Swap) 低4位与高4位交换;(4)控制转移类指令(17种助记符)ACALL(Absolute subroutine Call)子程序绝对调用;LCALL(Long subroutine Call)子程序长调用;RET(Return from subroutine)子程序返回;RETI(Return from Interruption)中断返回;SJMP(Short Jump)短转移;AJMP(Absolute Jump)绝对转移;LJMP(Long Jump)长转移;CJNE (Compare Jump if Not Equal)比较不相等则转移;DJNZ (Decrement Jump if Not Zero)减1后不为0则转移;JZ (Jump if Zero)结果为0则转移;JNZ (Jump if Not Zero) 结果不为0则转移;JC (Jump if the Carry flag is set)有进位则转移;JNC (Jump if Not Carry)无进位则转移;JB (Jump if the Bit is set)位为1则转移;JNB (Jump if the Bit is Not set) 位为0则转移;JBC(Jump if the Bit is set and Clear the bit) 位为1则转移,并清除该位;NOP (No Operation) 空操作;(5)位操作指令(1种助记符)SETB(Set Bit) 位置1。

1.通用数据传送指令.MOV----> moveMOVSX---->extended move with sign dataMOVZX---->extended move with zero dataPUSH---->pushPOP---->popPUSHA---->push allPOPA---->pop allPUSHAD---->push all dataPOPAD---->pop all dataBSWAP---->byte swapXCHG---->exchangeCMPXCHG---->compare and changeXADD---->exchange and addXLAT---->translate2.输入输出端口传送指令.IN---->inputOUT---->output3.目的地址传送指令.LEA---->load effective addressLDS---->load DSLES---->load ESLFS---->load FSLGS---->load GSLSS---->load SS4.标志传送指令.LAHF---->load AH from flagSAHF---->save AH to flagPUSHF---->push flagPOPF---->pop flagPUSHD---->push dflagPOPD---->pop dflag二、算术运算指令ADD---->addADC---->add with carryINC---->increase 1AAA---->ascii add with adjustDAA---->decimal add with adjustSUB---->substractSBB---->substract with borrowDEC---->decrease 1NEC---->negativeCMP---->compareAAS---->ascii adjust on substractDAS---->decimal adjust on substractMUL---->multiplicationIMUL---->integer multiplicationAAM---->ascii adjust on multiplicationDIV---->divideIDIV---->integer divideAAD---->ascii adjust on divideCBW---->change byte to wordCWD---->change word to double wordCWDE---->change word to double word with sign to EAX CDQ---->change double word to quadrate word三、逻辑运算指令AND---->andOR---->orXOR---->xorNOT---->notTEST---->testSHL---->shift leftSAL---->arithmatic shift leftSHR---->shift rightSAR---->arithmatic shift rightROL---->rotate leftROR---->rotate rightRCL---->rotate left with carryRCR---->rotate right with carry四、串指令MOVS---->move stringCMPS---->compare stringSCAS---->scan stringLODS---->load stringSTOS---->store stringREP---->repeatREPE---->repeat when equalREPZ---->repeat when zero flagREPNE---->repeat when not equalREPNZ---->repeat when zero flagREPC---->repeat when carry flagREPNC---->repeat when not carry flag五、程序转移指令1>无条件转移指令(长转移)JMP---->jumpCALL---->callRET---->returnRETF---->return far2>条件转移指令(短转移,-128到+127的距离内) JAE---->jump when above or equalJNB---->jump when not belowJB---->jump when belowJNAE---->jump when not above or equalJBE---->jump when below or equalJNA---->jump when not aboveJG---->jump when greaterJNLE---->jump when not less or equalJGE---->jump when greater or equalJNL---->jump when not lessJL---->jump when lessJNGE---->jump when not greater or equal JLE---->jump when less or equalJNG---->jump when not greaterJE---->jump when equalJZ---->jump when has zero flagJNE---->jump when not equalJNZ---->jump when not has zero flagJC---->jump when has carry flagJNC---->jump when not has carry flagJNO---->jump when not has overflow flag JNP---->jump when not has parity flagJPO---->jump when parity flag is oddJNS---->jump when not has sign flagJO---->jump when has overflow flagJP---->jump when has parity flagJPE---->jump when parity flag is evenJS---->jump when has sign flag3>循环控制指令(短转移)LOOP---->loopLOOPE---->loop equalLOOPZ---->loop zeroLOOPNE---->loop not equal LOOPNZ---->loop not zeroJCXZ---->jump when CX is zero JECXZ---->jump when ECX is zero 4>中断指令INT---->interruptINTO---->overflow interrupt IRET---->interrupt return5>处理器控制指令HLT---->haltWAIT---->waitESC---->escapeLOCK---->lockNOP---->no operationSTC---->set carryCLC---->clear carryCMC---->carry make changeSTD---->set directionCLD---->clear directionSTI---->set interruptCLI---->clear interrupt六、伪指令DW---->definw wordPROC---->procedureENDP---->end of procedure SEGMENT---->segmentASSUME---->assumeENDS---->end segmentEND---->end。

相关主题