

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Instruction Flag Flag C OV AC Instruction C OV AC ADD X X X CLR C O ADDC X X X CPL C X SUBB X X X ANL C,bit X MUL O X ANL C,/bit X DIV O X ORL C,bit X DA X ORL C,/bit X RRC X MOV C,bit X RLC X CJNE X SETB C 1 Note that operations on SFR byte address 20 6 or bit addresses 20 9-215 (i.e. the PSW or bits in the PSW) will also affect flag settings. Mnemonic Description Byte Cycle Arithmetic operations ADD A,Rn Add register to accumulator 1 1 ADD A,direct Add direct byte to accumulator 2 1 ADD A,@Ri Add indirect RAM to accumulator 1 1 ADD A,#data Add immediate data to accumulator 2 1 ADDC A,Rn Add register to accumulator with carry flag 1 1 ADDC A,direct Add direct byte to A with carry flag 2 1 ADDC A,@Ri Add indirect RAM to A with carry flag 1 1 ADDC A,#data Add immediate data to A with carry flag 2 1 SUBB A,Rn Subtract register to accumulator with borrow 1 1 SUBB A,direct Subtract direct byte to A with carry borrow 2 1 SUBB A,@Ri Subtract indirect RAM to A with carry borrow 1 1 SUBB A,#data Subtract immediate data to A with carry borrow 2 1 INC A Increment accumulator 1 1 INC Rn Increment register 1 1 INC direct Increment direct byte 2 1 INC @Ri Increment indirect RAM 1 1 DEC A Decrement accumulator 1 1 DEC Rn Decrement register 1 1 DEC direct Decrement direct byte 2 1 DEC @Ri Decrement indirect RAM 1 1 INC DPTR Increment data pointer 1 2 MUL AB Multiply A and B - > [B hi]:[A lo] 1 4 DIV AB Divide A by B -> A=result, B=remainder 1 4 DA A Decimal adjust accumulator 1 1 CLR A Clear accumulator 1 1 Mnemonic Description Byte Cycle CPL A Complement accumulator 1 1 RL A Rotate accumulator left 1 1 RLC A Rotate accumulator left through carry 1 1 RR A Rotate accumulator right 1 1 RRC A Rotate accumulator right through carry 1 1 SWAP A Swap nibbles within the accumulator 1 1 Logic operations ANL A,Rn AND register to accumulator 1 1 ANL A,direct AND direct byte to accumulator 2 1 ANL A,@Ri AND indirect RAM to accumulator 1 1 ANL A,#data AND immediate data to accumulator 2 1 ANL direct,A AND accumulator to direct byte 2 1 ANL direct,#data AND immediate data to direct byte 3 2 ORL A,Rn OR register to accumulator 1 1 ORL A,direct OR direct byte to accumulator 2 1 ORL A,@Ri OR indirect RAM to accumulator 1 1 ORL A,#data OR immediate data to accumulator 2 1 ORL direct,A OR accumulator to direct byte 2 1 ORL direct,#data OR immediate data to direct byte 3 2 XRL A,Rn Exclusive OR register to accumulator 1 1 XRL A,direct Exclusive OR direct byte to accumulator 2 1 XRL A,@Ri Exclusive OR indirect RAM to accumulator 1 1 XRL A,#data Exclusive OR immediate data to accumulator 2 1 XRL direct,A Exclusive OR accumulator to direct byte 2 1 XRL direct,#data Exclusive OR immediate data to direct byte 3 2 Boolean variable manipulation CLR C Clear carry flag 1 1 CLR bit Clear direct bit 2 1 SETB C Set carry flag 1 1 SETB bit Set direct bit 2 1 CPL C Complement carry flag 1 1 CPL bit Complement direct bit 2 1 ANL C,bit AND direct bit to carry flag 2 2 ANL C,/bit AND complement of direct bit to carry 2 2 ORL C,bit OR direct bit to carry flag 2 2 ORL C,/bit OR complement of direct bit to carry 2 2 MOV C,bit Move direct bit to carry flag 2 1 MOV bit,C Move carry flag to direct bit 2 2 Program and machine control ACALL addr 11 Absolute subroutine call 2 2 LCALL addr 16 Long subroutine call 3 2 RET Return from subroutine 1 2 RETI Return from interrupt 1 2 AJMP addr 11 Absolute jump 2 2 LJMP addr 16 Long jump 3 2 SJMP rel Short jump (relative address) 2 2 JMP @A+DPTR Jump indirect relative to the DPTR 1 2 JZ rel Jump if accumulator is zero 2 2 JNZ rel Jump if accumulator is not zero 2 2 JC rel Jump if carry flag is set 2 2 JNC rel Jump if carry flag is not set 2 2 JB bit,rel Jump if bit is set 3 2 JNB bit,rel Jump if bit is not set 3 2 JBC bit,rel Jump if direct bit is set and clear bit 3 2 CJNE A,direct,rel Compare direct byte to A and jump if not equal 3 2 Mnemonic Description Byte Cycle CJNE A,#data,rel Compare immediate to A and jump if not equal 3 2 CJNE Rn,#data,rel Compare immed. to reg. and jump if not equal 3 2 CJNE @Rn,#data,rel Compare immed. to ind. and jump if not equal 3 2 DJNZ Rn,rel Decrement register and jump in not zero 2 2 DJNZ direct,rel Decrement direct byte and jump in not zero 3 2 NOP No operation 1 1 Data transfer MOV A,Rn Move register to accumulator 1 1 MOV A,direct*) Move direct byte to accumulator 2 1 MOV A,@Ri Move indirect RAM to accumulator 1 1 MOV A,#data Move immediate data to accumulator 2 1 MOV Rn,A Move accumulator to register 1 1 MOV Rn,direct Move direct byte to register 2 2 MOV Rn,#data Move immediate data to register 2 1 MOV direct,A Move accumulator to direct byte 2 1 MOV direct,Rn Move register to direct byte 2 2 MOV direct,direct Move direct byte to direct byte 3 2 MOV direct,@Ri Move indirect RAM to direct byte 2 2 MOV direct,#data Move immediate data to direct byte 3 2 MOV @Ri,A Move accumulator to indirect RAM 1 1 MOV @Ri,direct Move direct byte to indirect RAM 2 2 MOV @Ri,#data Move immediate data to indirect RAM 2 1 MOV DPTR,#data 16 Load data pointer with a 16-bit constant 3 2 MOVC A,@A+DPTR Move code byte relative to DPTR to accumulator 1 2 MOVC A,@A+PC Move code byte relative to PC to accumulator 1 2 MOVX A,@Ri Move external RAM ( 8 - bit addr.) to A 1 2 MOVX A,@DPTR Move external RAM (16-bit addr.) to A 1 2 MOVX @Ri,A Move A to external RAM (8-bit addr.) 1 2 MOVX @DPTR,A Move A to external RAM ( 1 6-bit addr.) 1 2 PUSH direct Push direct byte onto stack 2 2 POP direct Pop direct byte from stack 2 2 XCH A,Rn Exchange register to accumulator 1 1 XCH A,direct Exchange direct byte to accumulator 2 1 XCH A,@Ri Exchange indirect RAM to accumulator 1 1 XCHD A,@Ri Exchange low-order nibble indir. RAM with A 1 1 *) MOV A,ACC is not a valid instruction jne A,#data,@ (jump if A! = data) cjne A,#data,@ je A, #data,@ (jump if A == data) add A,#low(−data) or cjne A,#(data),ne jz @ jmp @ ne: ... ja, jnbe A,#data,@ (jump if A > data) add A,#low(−data−1) or cjne A,#(data+ 1 ),ne jc @ ne: jnc @ jae, jnb A,#data,@ (jump if A >= data) add A,#low(−data) or cjne A,#(data),ne jc @ ne: jnc @ jb, jnae A,#data,@ (jump if A < data) add A,#low,(−data) or cjne A,#(data),ne jnc @ ne: jc @ jbe, jna A,#data,@ (jump if A <= data) add A,#low(−data−1) or cjne A,#(data+ 1 ),ne jnc @ ne: jc @ switch A <,==,> #data (no A modification) cjne A,#data,ne ... ; execute code if A==data ne: jc is_below ; jump if A<data jnc is_above ; jump if A>data or exec. code EEnnjjooyy IItt!! MMaatteess
CuuDuongThanCong.com https://fb.com/tailieudientucntt Riฏฺ
Mates (c) 1995,
DEC
A8 ..... address 8 bits A16 ... address 16 bits AR .... relative address 8 bits BIT ... bit's address D ....... data 8 bits
ADDC ORL ANL XRL MOV MOV SUBB MOV CJNE XCH DJNZ MOV
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
-. - @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R 0 1 2 3 4 5 6 7 8 9 A B C D E F - 2 2c D16 data 16 bits - LJMP A - 15 1c - INC R - 14 1c - INC R - 13 1c - INC R - 12 1c - INC R - 28 1c - DEC R - 29 1c - DEC R - 30 1c - DEC R - 31 1c - DEC R - 44 1c - ADD A,R - 45 1c - ADD A,R - 46 1c - ADD A,R - 47 1c - ADD A,R - 60 1c - 76 1c - ORL A,R - 77 1c - ORL A,R - 78 1c - ORL A,R - 79 1c - ORL A,R - 92 1c - ANL A,R - 93 1c - ANL A,R - 94 1c - ANL A,R - 95 1c - ANL A,R - 108 1c - XRL A,R - 109 1c - XRL A,R - 110 1c - XRL A,R - 111 1c - XRL A,R - 124 1c - 140 2c MOV R4,#D - MOV A8,R - 172 2c - MOV R4,A - 204 1c - XCH A,R - 236 1c - MOV A,R - 252 1c - 1 2c MOV R4,A - AJMP 0A - 0 1c - 17 2c NOP - ACALL 0A