Samsung KS57C2308 Manual page 133

Single-chip cmos microcontroller
Table of Contents

Advertisement

KS57C2308/P2308/C2316/P2316
JR
— Jump Relative (Very Short)
JR
(Continued)
Examples:
1. A short form for a relative jump to label "KK" is the instruction
where "KK" must be within the allowed range of current PC–15 to current PC+16. The JR
instruction has in this case the effect of an unconditional JP instruction.
2. In the following instruction sequence, if the instruction "LD WX, #02H" were to be executed in
place of "LD WX,#00H", the program would jump to 1004H and "JPS CCC" would be
executed. If "LD EA,#03H" were to be executed, the jump would be to1006H and "JPS DDD"
would be executed.
3. Here is another example:
XXX
If "LD EA,#01H" were to be executed in place of "LD EA,#00H", the program would jump to
1001H and address 30H would contain the value 1H. If "LD EA,#02H" were to be executed,
the jump would be to 1002H and address 30H would contain the value 2H.
JR KK
ORG
1000H
JPS
AAA
JPS
BBB
JPS
CCC
JPS
DDD
LD
WX,#00H
LD
EA,WX
ADS
WX,EA
JR
@WX
ORG
1100H
LD
A,#0H
LD
A,#1H
LD
A,#2H
LD
A,#3H
LD
30H,A
JPS
YYY
LD
EA,#00H
JR
@EA
; WX
00H
; WX
(WX) + (WX)
; Current PC13–8 (10H) + WX (00H) = 1000H
; Jump to address 1000H and execute JPS AAA
; Address 30H
A
; EA
00H
; Jump to address 1100H
; Address 30H
00H
SAM47 INSTRUCTION SET
5-59

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents