KS57C2308/P2308/C2316/P2316
SAM47 INSTRUCTION SET
5-59
JR
— Jump Relative (Very Short)
JR
(Continued)
Examples:
1. A short form for a relative jump to label “KK” is the instruction
JR KK
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.
ORG
1000H
JPS
AAA
JPS
BBB
JPS
CCC
JPS
DDD
LD
WX,#00H
; WX
←
00H
LD
EA,WX
ADS
WX,EA
; WX
←
(WX) + (WX)
JR
@WX
; Current PC13–8 (10H) + WX (00H) = 1000H
; Jump to address 1000H and execute JPS AAA
3. Here is another example:
ORG
1100H
LD
A,#0H
LD
A,#1H
LD
A,#2H
LD
A,#3H
LD
30H,A
; Address 30H
←
A
JPS
YYY
XXX
LD
EA,#00H
; EA
←
00H
JR
@EA
; Jump to address 1100H
; Address 30H
←
00H
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.
Summary of Contents for C2316
Page 30: ...ADDRESS SPACES KS57C2308 P2308 C2316 P2316 2 22 NOTES ...
Page 168: ...SAM47 INSTRUCTION SET KS57C2308 P2308 C2316 P2316 5 94 NOTES ...
Page 170: ......
Page 206: ...POWER DOWN KS57C2308 P2308 C2316 P2316 8 8 NOTES ...
Page 210: ...RESET KS57C2308 P2308 C2316 P2316 9 4 NOTES ...
Page 222: ...I O PORTS KS57C2308 P2308 C2316 P2316 10 12 NOTES ...
Page 272: ...LCD CONTROLLER DRIVER KS57C2308 P2308 C2316 P2316 12 24 NOTES ...
Page 280: ...SERIAL I O INTERFACE KS57C2308 P2308 C2316 P2316 13 8 NOTES ...
Page 294: ...MECHANICAL DATA KS57C2308 P2308 C2316 P2316 15 2 NOTES ...
Page 310: ...KS57P2308 P2316 OTP KS57C2308 P2308 C2316 P2316 16 16 NOTES ...
Page 318: ......
Page 320: ......
Page 322: ......
Page 325: ......
Page 327: ......