Incw — Increment Word - Samsung S3F84B8 User Manual

8-bit cmos
Hide thumbs Also See for S3F84B8:
Table of Contents

Advertisement

S3F84B8_UM_REV 1.00
6.3.31 INCW — INCREMENT WORD
dst
INCW
dst  dst + 1
Operation:
The contents of destination (containing an even address) and the byte following that location are
treated as a single 16-bit value incremented by one.
C: Unaffected.
Flags:
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:
opc
Given R0 = 1AH, R1 = 02H, register 02H = 0FH, and register 03H = 0FFH:
Examples:
INCW RR0
INCW @R1
In the first example, the working register pair RR0 contains the value 1AH in register R0 and 02H
in register R1. The statement "INCW RR0" increments the 16-bit destination by one, leaving the
value 03H in register R1. In the second example, the statement "INCW @R1" uses Indirect
Register (IR) addressing mode to increment the contents of general register 03H from 0FFH to
00H and register 02H from 0FH to 10H.
A system malfunction may occur if you use a Zero (Z) flag (FLAGS.6) result together with an INCW
NOTE:
instruction. To avoid this problem, it is recommend that you use INCW, as shown in the following example:
LOOP: INCW RR0
dst
R0 = 1AH, R1 = 03H
Register 02H = 10H, register 03H = 00H
LD
R2,R1
OR
R2,R0
JR
NZ,LOOP
Bytes
Cycles
2
6-44
6 INSTRUCTION SET
Opcode
Addr Mode
(Hex)
8
A0
8
A1
dst
RR
IR

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents