MCS”-51 PROGRAMMER’SGUIDE AND INSTRUCTION SET
ADD A,@Ri
Bytes:
Cycles:
Encoding:
Operation:
ADD &#dats
Bytes
Cycles:
Encoding:
Operation:
1
1
IO O1OI Ollil
ADD
(A) - (A) + ((%))
2
1
0010
0100
[
immediatedata
ADD
(A) - (A) + #data
ADDC A,<src-byte>
Function:
Description:
Example:
Add with Carry
ADDC simultaneouslyadds the byte variableindicated,the carry tlag and the Accumulator
contents,leavingthe result in the Accumulator.The carry and auxiliary-carryfiagsare set,
respectively,if there is a carry-out frombit 7 or bit 3, and clearedotherwise.When adding
unsignedintegers,the carry tlag indicatesan overtlow
Occured.
OVisset ifthereisa carry-outofbit 6butnotoutofbit 7,or a carry-outofbit 7but notout of
bit 6; otherwiseOVis cleared. Whenaddingsignedintegers,OVindicatssa negativenumber
producedas the sum of two positiveoperandsor a positivesumfromtwo negativeoperands.
Four souroeoperandaddressingmodesare allowed:register,direct,register-indirect,or imme-
diate.
‘l%eAccumulatorholdsOC3H(11OOOO11B)and registerOholdsOAAH(10101O1OB)withthe
~ fig set. The instruction,
ADDC A,RO
willleave6EH(0110111OB)in the AccumulatorwithAC clearedand both the Carryflagand
Ov set to 1.
2-30