Вы находитесь на странице: 1из 4

i~.

M=”-51 PROGRAMMER’SGUIDE AND INSTRUCTION SET

M=@-51 INSTRUCTION SET


Table 10.8051 Inatruotion Set Summary

Interrupt ResponseTime: Refer to Hardware De- Oaeilfstor


Mnemonic Dsseription
scription Chapter. ‘m Period
Instructions that Affect Flag Settings(l) ---
ADD
.-
A,Rn
.
Ma registerto 1 12
Instruetkm Ffsg Inetmetion Flsg Accumulator
C OV AC C OV AC ADD A,direct Adddirectbyteto 2 12
ADD xx X CLRC o Accumulator
ADDC xx X CPLC x ADD A,@Ri Addindirect
RAM 1 12
SUBB xx X ANLC,bit X toAccumulator
MUL ox ANLC,/bit X ADD A,#date Addimmediate 2 12
DIV ox ORLC,bit X dateto
DA x ORLC,bit X Accumulator
RRC x MOVC,bit X ADDC A,Rn Addregister
to 1 12
RLC x CJNE x Accumulator
SETBC 1 withCarry
(l)FJotethat operationson SFR byte address 208or ADDC A,dirsct Adddirectbyteto 2 12
bit addresses 209-215(i.e., the PSW or bits in the Accumulator
PSW) will also afect flag settings. withCarry
ADDC A.@Ri Addindirect 1 12
Nota on inetruetionsat and ad&aesingmodes: RAMto
Rn — Register R7-RO of the currently se- Accumulator
lectedRegister Bank. withCarry
direct — 8-bit internal data location’s address. ADDC A,#date Addimmediate 2 12
This could been Internal Dsta RAM datetoAcc
locetion (0-127) or a SFR [i.e., I/O withCeny
pofi control register, status register, SUBB A,Rn Subtract
Register 1 12
etc. (128-255)]. fromAcewith
@Ri — 8-bit internal data RAM location (O- borrow
255)addreasedindirectly through reg- SUBB A,direct Subtrectdirect 2 12
ister R1 or RO. bytefromAcc
#data — 8-bitco~~t includedin instruction. withborrow
#data 16— 16-bitconstant includedin instmction. SUBB A.@Ri Subfrectindiract 1 12
addr 16 — 16-bit destination address. Used by RAMfromACC
LCALL & LJMP. A branch can be withborrow
anywhere within the 64K-byte Pro- A.#date Subtract 2 12
gram Memory SddR$S SpCCe. immediatedate
addr 1 — n-bit destination sddrrss. Used by fromAccwith
ACALL& AJMP. The branch willbe borrw
within the same 2K-byte page of pro- INC A Increment 1 12
gram memo~ as the first byte of the Accumulator
foil-g instruction. INC Rn Incrsmsnt
register 1 12
rel — Signed(two’scomplement)S-bitoffset INC direct Increment direct 2 12
byte.Usedby SJMP end all condition- byte
al jumps. Range is -128 to + 127 INC @Ri Incrementdirect 1 12
bytes relative to first byte of the fol- RAM
lowinginstruction. DEC A Decrement 1 12
bit — Direct Addressedbit in Internal Data Accumulator
W or SpecialFunction Register. DEC Rn Decrement 1 12
Regieter
DEC direct Decrement direct 2 12
byte
DEC @Ri Decrement 1 12
indirect
RAM
WImnemonics
copyrighted
@lntelCor’pxetion
1980

.
2-21
i~e McS@-51PROGRAMMER’SGUIDE AND INSTRUCTION SET

Table 10.8051 Inetruotion Sat Summary (Continued)


~we o:acw~r
Mnemonic Deaoription

tRITNWTIC OPERATIONS (Continued)


.LUUIGAL
------ urtm
----------
IIUNS {wmunuao)
,A . . ,.

NC DPTR Increment Date 1 24 RL A 1 12


Pointer Accumulator Left
dUL AB MultiPiy
A& B 1 48 RLC A Rotate 1 12
)IV AB Ditie A byB 1 48 Accumulator Left
)A A DecimelAdjuet 1 12 through theCarry
Accumulator RR A Rotate 1 12
.OGICALOPERATtONS Accumulator
\NL A,Rn ANDRegieterto 1 12 Right
Accumulator RRC A Rotate 1 12
tNL A,direct ANDdiractbyte 2 12 Accumulator
toAccumulator Rightthrough
4NL A,@Ri ANDindirect 1 12 mecerry
RAMto SWAP A Swapnibbles 1 12
Accumulator withinthe
4NL A,#date ANDimmediate 2 12 Accumulator
datato DATATRANSFER
Accumulator MOV A,Rn Move 1 12
4NL direct,A ANDAccumulator 2 12 register
to
todirectbyte Accumulator
4NL diract,#data ANDimmediate 3 24 MOV A,direct Movediract 2 12
datatodirectbyte byteto
)RL A,Rn ORregister to 1 12 Accumulator
Accumulator MOV A,@Ri Moveindirect 1 12
2RL A,direct ORdirectbyteto 2 12 RAMto
Accumulator Accumulator
2RL A,@Ri ORindiractRAM 1 12 MOV A,#date Move 2 12
toAccumulator immediate
3RL A,#date ORimmediate 2 12 dateto
datato Accumulator
Accumulator MOV Rn.A Move 1 12
3RL dirac4,A ORAccumulator 2 12 Accumulator
todirectbyte toregister
3RL dirsct,~date ORimmediate 3 24 MOV Rn,direot Movedirect 2 24
detetodiractbyte byteto
KRL A,Rn Excluaiva-OR 1 12 register
regieterto MOV Rn,#date Move 2 12
Armmulator immediate date
I(RL A,diraot ExclusMe-OR 2 12 toregister
directbyteto MOV direct,A Mova 2 12
Accumulator Accumulator
KRL A,@Ri Exclush/e-OR 1 12 todirectbyte
indirect
RAMto MOV direct,Rn Moveregister 2 24
Accumulator todirectbyte
KRL A,#data Exclusiva-OR 2 12 MOV diract,directMovedirect 3 24
immediate datato bytatodiract
Accumulator MOV direct,@Ri Moveindirect 2 24
KRL direct,A Excluaive-OR 2 12 RAMto
Accumulator to directbyte
directbyte MOV direct,#date Move 3 24
KRL direct,gdata Exclueive-OR 3 24 immediate data
immediate date todireotbyte
todirectbyte MOV @Ri,A Move 1 12
CLR A Clear 1 12 Accumulator to
Accumulate
Complement 1 12
I indirect
RAM
CPL A Allmnemonics
copyrighted@lnteiCorporation
19S0
Accumulator
.2-22
in~. M=”-51 PROGRAMMER’S GUIDE AND INSTRUCTION SET

Table 10.8051 Instruction Set Summary(Continued)

I Mnemonic OeecriptfonByte ~~k~o’ Mnemonic Description Byte


Oeciltetor
Period
IDATATRANSFER (continued) BOOLEAN VARIABLEMANIPULATION
MOV @Ri,direct Movedirect 2 24 GLH L wearwny 1 12
byteto CLR bit Clesrdirectbit 2 12
indirect RAM SETB c SetCarry 1 12
MOV @Ri,#date Move 2 12 bit Setdirectbit 2 12
immediate CPL c Complement 1 12
dateto carry
indirect RAM CPL bit Complement 2 12
MOV DPTR,#data16LoedDets 3 24 directbit
Pointerwitha ANL C,bit ANDdirectbit 2 24
16-bitconstant toCARRY
MOVC A,@A+DPTR MoveMe 1 24 ANL C,/bit ANDcomplement 2 24
byterelativeto ofdirectbit
DPTRtoAcc tocarry
MOVC A,@A+PC MoveCode 1 24 ORL C,bit ORdirectbit 2 24
byterelativeto tocarry
PCtoAcc ORL C,/bit ORcomplement 2 24
MOVX A,@Ri Move 1 24 ofdirectbit
External tocarry
RAM(8-bit MOV C,bit Movedirectbit 2 12
eddr)toAcc tocarry
MOVX A,@DPTR Move 1 24 MOV bit,C MoveCsrryto 2 24
External directbit
RAM(l&bit JC rel JumpifCsny 2 24
addr)toAcc isset
MOVX @Ri,A MoveAccto 1 24 JNC rel JumpifCarry 2 24
External RAM notset
(8-bitaddr) JB bit,rel Jumpifdirecf 3 24
MOVX @DPTR,A MoveAccto 1 24 Bitisset
External RAM JNB bi$rel Jumpifdirect 3 24
(lS-bitaddr) BitisNotset
PUSH direct Pushdirect 2 24 JBC bit.rel Jumoifdirect 3 24
byteonto Bitisset&
stack clearbit
POP direct Popdirect 2 24 PROGRAMBRANCHING
bytefrom ACALL addrl1 Absolute 2 24
stack Subroutine
XCH A,Rn Exchange 1 12 call
registerwith LCALL addr16 Long 3 24
Subroutine
XCH A,direct Exchange 2 12 call
directbyte RET Returnfrom 1 24
with Subroutine
RETI Retumfrom 1 24
XCH A,@Ri Exchange 1 12 intempt
indirect
RAM AJMP addrll Absolute 2 24
with Jump
WMP addr16 LongJump 3 24
XCHD A,@Ri Exchange low- 1 12 SJMP rel ShortJumo 2 24
orderDigif (relativeaddr)
indirect
RAM VImnemonicscopyrigMed @lntelCorporation
1980
with Acc
I

2-23
int# MCS@-51PROGRAMMER’S GUIDE AND INSTRUCTION SET

Table 10.8051 Instruction Set SummarY (Continued)

Mnemonic Description Byte ‘~or Mnemonic Description Syte ~~or


.FmWrIANI
. . . . . .. BmANGmNQ
-m . ..-,,,..- ,-- —.,....
(wnunueq
.’,
PROGRAM BRANCHING (Continued)
JMP @A+DPTR Jumpindirecf 1 24 CJNE Rn,#date,rei Compare 3 24
relativetothe immediate to
DPTR register
and
JZ rel Jumpif 2 24 JumpifNot
Accumulator Equal
isZero CJNE @Ri,#data,rel Compare 3 24
JNZ rel Jumpif 2 24 immediate to
Accumulator indirect
and
isNotZero JumpifNot
CJNE A,direct,rei Compare 3 24 Equal
directbyteto DJNZ Rn,rei Decrement 2 24
AccandJump registerand
ifNotEquai JumpifNot
CJNE A,#date,rel Compare 3 24 Zero
immediate to DJNZ direct,rel Decrement 3 24
AccandJumo directbyte
ifNotEqual andJumpif
NotZero
NOP NoOperation 1 12
dlmnemonics
copyrighted @intelCorporation
1980

2-24

Вам также может понравиться