Jp — Jump - Samsung S3F84B8 User Manual

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

Advertisement

S3F84B8_UM_REV 1.00
6.3.33 JP — JUMP
cc,dst (Conditional)
JP
dst
JP
If cc is true, PC  dst.
Operation:
The conditional JUMP instruction transfers program control to the destination address if the
condition specified by condition code (cc) is true; otherwise, the instruction following the JP
instruction is executed. The unconditional JP simply replaces the contents of the PC with the
contents of the specified register pair. Control then passes to the statement addressed by the PC.
No flags are affected.
Flags:
(1)
Format:
cc | opc
opc
NOTE:
1.
The 3 byte format is used for a conditional jump and the 2 byte format for an unconditional jump.
2.
In the first byte of the three-byte instruction format (conditional jump), the condition code and the opcode are both
four bits.
Given the carry flag (C) = "1", register 00 = 01H, and register 01 = 20H:
Examples:
JP
JP
The first example shows a conditional JP. Assuming that the carry flag is set to "1", the statement
"JP C,LABEL_W" replaces the contents of the PC with the value 1000H and transfers control to
that location. If the carry flag was not set, control would have passed to the statement
immediately following the JP instruction.
The second example shows an unconditional JP. The statement "JP @00" replaces the
contents of the PC with the contents of register pair 00H and 01H, leaving the value 0120H.
(Unconditional)
(2)
dst
dst
C,LABEL_W
@00H
Bytes
3
2
LABEL_W = 1000H, PC = 1000H
PC = 0120H
6-46
6 INSTRUCTION SET
Cycles
Opcode
(Hex)
8
ccD
cc = 0 to F
8
30
Addr Mode
dst
DA
IRR

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents