Texas Instruments MSC1210 User Manual

Page 288

Advertising
background image

8052 Instruction Set

E-4

ADD, ADDC

Add Value, Add Value with Carry

Syntax

ADD A,operand
ADDC A,operand

Instructions

OpCode

Bytes

Cycles

Flags

ADD A,#data8

0x24

2

1

C, AC, OV

ADD A,direct

0x25

2

1

C, AC, OV

ADD A,@R0

0x26

1

1

C, AC, OV

ADD A,@R1

0x27

1

1

C, AC, OV

ADD A,R0

0x28

1

1

C, AC, OV

ADD A,R1

0x29

1

1

C, AC, OV

ADD A,R2

0x2A

1

1

C, AC, OV

ADD A,R3

0x2B

1

1

C, AC, OV

ADD A,R4

0x2C

1

1

C, AC, OV

ADD A,R5

0x2D

1

1

C, AC, OV

ADD A,R6

0x2E

1

1

C, AC, OV

ADD A,R7

0x2F

1

1

C, AC, OV

ADDC A,#data8

0x34

2

1

C, AC, OV

ADDC A,direct

0x35

2

1

C, AC, OV

ADDC A,@R0

0x36

1

1

C, AC, OV

ADDC A,@R1

0x37

1

1

C, AC, OV

ADDC A,R0

0x38

1

1

C, AC, OV

ADDC A,R1

0x39

1

1

C, AC, OV

ADDC A,R2

0x3A

1

1

C, AC, OV

ADDC A,R3

0x3B

1

1

C, AC, OV

ADDC A,R4

0x3C

1

1

C, AC, OV

ADDC A,R5

0x3D

1

1

C, AC, OV

ADDC A,R6

0x3E

1

1

C, AC, OV

ADDC A,R7

0x3F

1

1

C, AC, OV

ADD and ADDC both add the value operand to the value of the accumulator,
leaving the resulting value in the accumulator. The value operand is not af-
fected. ADD and ADDC function identically except that ADDC adds the value
of operand as well as the value of the carry flag, whereas ADD does not add
the carry flag to the result.

The carry (C) bit is set if there is a carry-out of bit 7. In other words, if the un-
signed summed value of the accumulator, operand, and (in the case of ADDC)
the carry flag exceeds 255, the carry bit is set. Otherwise, the carry bit is cleared.

Advertising