A tak to wygląda:
Rn working register R0-R7
Direct 128 internal RAM locations, any IO port, control or status register.
For example : P1, P3, ACC
@Ri indirect internal RAM location addressed by register R0 or R1
#data 8-bit constant included in instruction
#data16 16-bit constant included in instruction
Bit 128 software flags, any IO pin, control or status bit
For example : ACC.0, P1.0, P1.1
----------------------------
Boolean variable maniulation
CLR C clear carry flag
CLR bit clear direct bit
SETB C set carry flag
SETB bit set direct bit
CPL C complement carry flag
CPL bit complement direct bit
ANL C, bit AND direct bit to carry flag
ORL C,bit OR direct bit to carry flag
MOV C,bit Move direct bit to carry flag
------------------------
Program and machine control
LCALL addr16 long subroutine call
RET return from subroutine
RETI return from interrupt
LJMP addr16 long jump
SJMP rel short jump (relative address)
JMP @A+DPTR jump indirect relative to the DPTR
JZ rel jump if accu is zero
JNZ rel jump if accu is not zero
JC rel jump if carry flag is set
JNC rel jump if carry flag is not set
JB bit,rel jump if direct bit is set
JNB bit,rel jump if direct bit is not set
JBC bit,rel jump if direct bit is set & clear bit
CJNE A,direct,rel compare direct to A & jump of not equal
CJNE A,#data,rel comp. I'mmed. to A & jump if not equal
CJNE Rn,#data,rel comp. I'mmed. to reg. & jump if not equal
CJNE @Ri,#data,rel comp. I'mmed. to ind. & jump if not equal
DJNZ Rn,rel decrement register & jump if not zero
DJNZ direct,rel decrement direct & jump if not zero
NOP No operation
----------------------
Arithmetic operations
ADD A,Rn add register to accu
ADD A,direct add register byte to accu
ADD A,@Ri add indirect RAM to accu
ADD A,#data add immediate data to accu
ADDC A,Rn add register to accu with carry
ADDC A,direct add direct byte to accu with carry flag
ADDC A,@Ri add indirect RAM to accu with carry flag
ADDC A,#data add immediate data to accu with carry flag
SUBB A,Rn subtract register from A with borrow
SUBB A,direct subtract direct byte from A with borrow
SUBB A,@Ri subtract indirect RAM from A with borrow
SUBB A,#data subtract immediate data from A with borrow
INC A increment accumulator
INC Rn increment register
INC direct increment direct byte
INC@Ri increment indirect RAM
DEC A decrement accumulator
DEC Rn decrement register
DEC direct decrement direct byte
DEC@Ri decrement indirect RAM
INC DPTR increment datapointer
MUL AB multiply A & B
DIV AB divide A by B
DA A decimal adjust accu
--------------------
Logical operations
ANL A,Rn AND register to accu
ANL A,direct AND direct byte to accu
ANL A,@Ri AND indirect RAM to accu
ANL A,#data AND immediate data to accu
ANL direct,A AND accu to direct byte
ANL direct,#data AND immediate data to direct byte
ORL A,Rn OR register to accu
ORL A,direct OR direct byte to accu
ORL A,@Ri OR indirect RAM to accu
ORL A,#data OR immediate data to accu
ORL direct,A ORL accu to direct byte
ORL direct,#data ORL immediate data to direct byte
XRL A,Rn exclusive OR register to accu
XRL A,direct exclusive OR direct byte to accu
XRL A,@Ri exclusive OR indirect RAM to accu
XRL A,#data exclusive OR immediate data to accu
XRL direct,A exclusive OR accu to direct byte
XRL direct,#data exclusive OR immediate data to direct byte
CLR A clear accu
CPL A complement accu
RL A rotate accu left
RLC A rotate A left through the carry flag
RR A rotate accu right
RRC A rotate accu right through the carry flag
SWAP A swap nibbles within the accu
-----------------
Data transfer
MOV A,Rn move register to accu
MOV A,direct move direct byte to accu
MOV A,@Ri move indirect RAM to accu
MOV A,#data move immediate data to accu
MOV Rn,A move accu to register
MOV Rn,direct move direct byte to register
MOV Rn,#data move immediate data to register
MOV direct,A move accu to direct byte
MOV direct,Rn move register to direct byte
MOV direct,direct move direct byte to direct
MOV direct,@Ri move indirect RAM to direct byte
MOV direct,#data move immediate data to direct byte
MOV@Ri,A move accu to indirect RAM
MOV@Ri,direct move direct byte to indirect RAM
MOV@Ri,#data move immediate to indirect RAM
MOV DPTR,#data16 load datapointer with a 16-bit constant
MOVC A,@A+DPTR move code byte relative to DPTR to A
MOVC A,@A+PC move code byte relative to PC to A
MOVX A,@Ri move external RAM (8-bit) to A
MOVX A,@DPTR move external; RAM (16 bit) to A
MOVX@Ri,A move A to external RAM (8-bit)
MOVX@DPTR,A move A to external RAM (16-bit)
PUSH direct push direct byte onto stack
POP direct pop direct byte from stack
XCH A,Rn exchange register with accu
XCH A,direct exchange direct byte with accu
XCH A,@Ri exchange indirect RAM with A
XCHD A,@Ri exchange low-order digit ind. RAM w. A
I ucz się!!!
Informacja to nie rozkaz. Zatwierdź lub zignoruj.