in~o
M~’@.51 PROGRAMMER’SGUIDE AND INSTRUCTION SET
ADD A,<src-byte>
Function:
Description:
Example:
ADD A,Rn
Bytes:
Cycles:
Encoding:
Operation:
ADD A,direct
Bytatx
cycles:
Encoding:
Operation:
Add
ADDaddsthebytevariableindicatedto the Acewmdator,leavingtheresultin the Accumula-
tor. Thecarryandawdliary-carrytlags~e set,respectively,if there is a carry-outfrombit 7or
bit 3, and cleared otherwise. When adding unsignedintegers, the carry flag indicates an
overtlowoeared.
OVisset if thereis a carry-outofbit 6butnotoutofbit 7,or a carry-outofbit 7but not bit 6;
otherwiseOVis cleared.When addingsigmd integera,OV indicatesa negativenumber pro-
ducedas the sum of two positiveoperandsjor a paitive sum from two negativeoperands.
Foursouree operandaddressingmodesare allowed:register,direcLregister-indirect,or imme-
diate.
The Accumulatorholds OC3H(11OOOO11B)and register Oholds OAAH(10101O1OB).The
instruction,
ADD A,RO
willleave6DH (O11O1IO1B)in the Accumulatorwiththe AC flagclearedand both the carry
flagand OVSWto L
1
1
0010 Irrr
ADD
(A) + (A) + @O
2
1
0010 0101
I
directaddress
ADD
(A) + (A) + (direct)
2-29