i~. M=”-51 PROGRAMMER’SGUIDE AND INSTRUCTIONSET
M=@-51 INSTRUCTION SET
Table 10.8051 Inatruotion Set Summary
Interrupt ResponseTime: Refer to Hardware De-
scriptionChapter.
Instructions that Affect Flag Settings(l)
Instruetkm
Ffsg
Inetmetion Flsg
C OV AC C OV AC
ADD xx X CLRC
o
ADDC xx X CPLC x
SUBB
xx X ANLC,bit X
MUL ox ANLC,/bit X
DIV ox
ORLC,bit X
DA
x
ORLC,bit X
RRC
x MOVC,bit X
RLC x
CJNE
x
SETBC 1
(l)FJotethat
operationson SFRbyteaddress208or
bit addresses209-215(i.e., the PSW or bits in the
PSW)willalsoafect flag settings.
Nota on inetruetionsat and ad&aesingmodes:
Rn
— Register R7-RO of the currently se-
lectedRegisterBank.
direct — 8-bit internal data location’saddress.
Thiscouldbeen Internal Dsta RAM
locetion(0-127) or a SFR [i.e., I/O
pofi control register, status register,
etc. (128-255)].
@Ri
— 8-bitinternal data RAM location(O-
255)addreasedindirectlythroughreg-
ister R1or RO.
#data
— 8-bitco~~t includedin instruction.
#data 16— 16-bitconstantincludedin instmction.
addr
rel
bit
addr 16 — 16-bit destination address. Used by
LCALL & LJMP. A branch can be
anywhere within the 64K-byte Pro-
gramMemory
SddR$S SpCCe.
1 — n-bit destination sddrrss. Used by
ACALL&AJMP. Thebranch willbe
withinthe same 2K-bytepageof pro-
gram memo~ as the first byte of the
foil-g instruction.
— Signed(two’scomplement)S-bitoffset
byte.UsedbySJMPend all condition-
al jumps. Range is -128 to + 127
bytes relative to first byte of the fol-
lowinginstruction.
— Direct Addressedbit in Internal Data
W or SpecialFunction Register.
Mnemonic
Dsseription
Oaeilfstor
‘m Period
--- . - .
ADD
ADD
ADD
ADD
ADDC
ADDC
ADDC
ADDC
SUBB
SUBB
SUBB
INC
INC
INC
INC
DEC
DEC
DEC
DEC
A,Rn
A,direct
A,@Ri
A,#date
A,Rn
A,dirsct
A.@Ri
A,#date
A,Rn
A,direct
A.@Ri
A.#date
A
Rn
direct
@Ri
A
Rn
direct
@Ri
Ma registerto
Accumulator
Adddirectbyteto
Accumulator
AddindirectRAM
toAccumulator
Addimmediate
dateto
Accumulator
Addregisterto
Accumulator
withCarry
Adddirectbyteto
Accumulator
withCarry
Addindirect
RAMto
Accumulator
withCarry
Addimmediate
datetoAcc
withCeny
SubtractRegister
fromAcewith
borrow
Subtrectdirect
bytefromAcc
withborrow
Subfrectindiract
RAMfromACC
withborrow
Subtract
immediatedate
fromAccwith
borrw
Increment
Accumulator
Incrsmsntregister
Increment direct
byte
Incrementdirect
RAM
Decrement
Accumulator
Decrement
Regieter
Decrementdirect
byte
Decrement
1
2
1
2
1
2
1
2
1
2
1
2
1
1
2
1
1
1
2
1
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
indirectRAM
WImnemonicscopyrighted@lntelCor’pxetion1980
.
2-21