INSTRUCTION SET

S3C84E5/C84E9/P84E9

 

 

INC — Increment

INCdst

Operation: dst dst + 1

The contents of the destination operand are incremented by one.

Flags:

C:

Unaffected.

 

 

 

 

 

 

 

Z: Set if the result is "0"; cleared otherwise.

 

 

 

 

 

S: Set if the result is negative; cleared otherwise.

 

 

 

 

V: Set if arithmetic overflow occurred; cleared otherwise.

 

 

 

 

D:

Unaffected.

 

 

 

 

 

 

 

H:

Unaffected.

 

 

 

 

 

 

Format:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bytes

Cycles

Opcode

Addr Mode

 

 

 

 

 

 

 

 

 

(Hex)

dst

 

 

 

 

 

 

 

 

 

 

 

 

 

dst

opc

 

1

4

 

rE

r

 

 

 

 

 

 

 

 

r

=

0 to F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

opc

 

dst

 

2

4

 

20

R

 

 

 

 

 

 

 

 

4

 

21

IR

 

 

 

 

 

 

 

 

 

Examples:

Given:

R0

= 1BH, register 00H

= 0CH, and register 1BH

=

0FH:

 

 

INC R0

 

R0 = 1CH

 

 

 

 

 

 

 

INC 00H

Register 00H =

0DH

 

 

 

 

 

INC @R0

R0 = 1BH, register 01H =

10H

 

 

 

In the first example, if the destination working register R0 contains the value 1BH, the statement "INC R0" leaves the value 1CH in that same register.

The second example shows the effect an INC instruction has on the register at the location 00H, assuming that it contains the value 0CH.

In the third example, INC is used in Indirect Register (IR) addressing mode to increment the value of the register 1BH from 0FH to 10H.

6-44

Page 171
Image 171
Samsung S3C84E5 user manual INC Increment, INCdst Operation dst ← dst +, INC 00H, 0DH INC @R0