Monday, February 29, 2016

8051 ADDC Instruction

Addition with Carry

InstructionADDC A, src-byte
FunctionAdd with Carry
DescriptionADDC simultaneously adds the byte variable indicated, the carry flag and the Accumulator contents, leaving the result in the Accumulator. The carry and auxiliary-carry flags are set respectively, if there is a carry-out from bit 7 or bit 3, and cleared otherwise. When adding unsigned integers, the carry flag indicates an overflow occurred.
OV is set if there is a carry-out of bit 6 but not out of bit 7, or a carry-out of bit 7 but not out of bit 6; otherwise OV is cleared. When adding signed integers, OV indicates a negative number produced as the sum of two positive operands or a positive sum from two negative operands.
Four source operand addressing modes are allowed: register, direct, register-indirect, or immediate.
ExampleThe Accumulator holds 0C3H (11000011B) and register 0 holds 0AAH (10101010B) with the carry flag set. The following instruction,
ADDC A,R0
leaves 6EH (01101110B) in the Accumulator with AC cleared and both the Carry flag and OV set to 1.
VariantsADDC A,Rn
ADDC A, direct address
ADDC A,@Ri
ADDC A,#immediate data

InstructionADDC A,Rn
Bytes1
Cycles1
Encoding0 0 1 1 1 n n n
OperationA = A + C + Rn
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleADDC A, R0
Bytes: Number of bytes required to encode the instruction.
Cycles: Number of instruction cycles required to execute the instruction. Note that there are 12 oscillator cycles to one instruction cycle on a standard 8051.
Encoding: Lists the byte encoding for the instruction.
Operation: Lists, step-by-step, the operations performed by the instruction.
Flags Affected: are highlighted in Bold

InstructionADDC A,direct address
Bytes2
Cycles1
Encoding0 0 1 1 0 1 0 1 A7...A0
OperationA = A + C + (direct)
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleADDC A, 20h
Bytes: Number of bytes required to encode the instruction.
Cycles: Number of instruction cycles required to execute the instruction. Note that there are 12 oscillator cycles to one instruction cycle on a standard 8051.
Encoding: Lists the byte encoding for the instruction.
Operation: Lists, step-by-step, the operations performed by the instruction.
Flags Affected: are highlighted in Bold

InstructionADDC A,@Ri
Bytes1
Cycles1
Encoding0 0 1 1 0 1 1 i
OperationA = A + C + (Ri)
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleADDC A, @R1
Bytes: Number of bytes required to encode the instruction.
Cycles: Number of instruction cycles required to execute the instruction. Note that there are 12 oscillator cycles to one instruction cycle on a standard 8051.
Encoding: Lists the byte encoding for the instruction.
Operation: Lists, step-by-step, the operations performed by the instruction.
Flags Affected: are highlighted in Bold

InstructionADDC A, #immediate data
Bytes2
Cycles1
Encoding0 0 1 1 0 1 0 0 D7...D0
OperationA = A + C + immediate data
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleADDC A, #03h
Bytes: Number of bytes required to encode the instruction.
Cycles: Number of instruction cycles required to execute the instruction. Note that there are 12 oscillator cycles to one instruction cycle on a standard 8051.
Encoding: Lists the byte encoding for the instruction.
Operation: Lists, step-by-step, the operations performed by the instruction.
Flags Affected: are highlighted in Bold



Related topics:
8051 Arithmetic Operation Instructions   |   8051 ADD Instruction   |   8051 SUBB Instruction   |   8051 INC Instruction   |   8051 DEC Instruction   |   8051 MUL Instruction   |   8051 DIV Instruction   |   8051 DA Instruction

List of topics: 8051

No comments:

Post a Comment