ZiLOG Z8 PLUS User Manual page 122

Table of Contents

Advertisement

.75
P
Â
SWAP
Swap Nibbles
Instruction Format:
SWAP dst
Operation:
dst(7-4)
dst(3-0)
The contents of the lower four bits and upper four bits of the destination operand are swapped.
Flags:
When the instruction is executed, the flags are set as follows:
C:
The value set by the preceding instruction.
Z:
1 if the result is 0; otherwise, 0.
S:
1 if bit 7 of the result is 1; otherwise, 0.
V:
The value set by the preceding instruction.
D:
The value set by the preceding instruction.
H:
The value set by the preceding instruction.
Example: Register BCH contains B3H (10110011B). The following statement leaves the value 3BH
(00111011B) in register BCH. The Z and S flags are set to 0.
SWAP B3H
Op Code: F0 B3
Example: Working register R5 contains BCH and register BCH contains B3H (10110011B). The following
statement leaves the value 3BH (00111011B) in register BCH. The Z and S flags are set to 0.
SWAP @R5H
Op Code: F1 E5
OPC
dst
Address Mode
OPC (Hex)
F0
F1
dst
R
IR

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Z8 PLUS and is the answer not in the manual?

Questions and answers

Table of Contents