![Samsung S3C2501X User Manual Download Page 98](http://html.mh-extra.com/html/samsung/s3c2501x/s3c2501x_user-manual_340828098.webp)
S3C2501X
INSTRUCTION SET
3-7
3.4 BRANCH AND BRANCH WITH LINK (B, BL)
The instruction is only executed if the condition is true. The various conditions are defined Table 3-2. The
instruction encoding is shown in Figure 3-3, below.
31
24
27
Cond
Offset
28
23
[24] Link Bit
0 = Branch
1 = Branch with link
[31:28] Condition Field
25
101
L
0
Figure 3-3. Branch Instructions
Branch instructions contain a signed 2’s complement 24 bit offset. This is shifted left two bits, sign extended to 32
bits, and added to the PC. The instruction can therefore specify a branch of +/- 32Mbytes. The branch offset must
take account of the pre-fetch operation, which causes the PC to be 2 words (8 bytes) ahead of the current
instruction.
3.4.1 THE LINK BIT
Branch with Link (BL) writes the old PC into the link register (R14) of the current bank. The PC value written into
R14 is adjusted to allow for the pre-fetch, and contains the address of the instruction following the branch and link
instruction. Note that the CPSR is not saved with the PC and R14[1:0] are always cleared.
To return from a routine called by branch with link use MOV PC,R14 if the link register is still valid or LDM
Rn!,{..PC} if the link register has been saved onto a stack pointed to by Rn.
3.4.2 INSTRUCTION CYCLE TIMES
Branch and branch with link instructions take 2S + 1N incremental cycles, where S and N are defined as
sequential (S-cycle) and internal (I-cycle).
Summary of Contents for S3C2501X
Page 18: ......
Page 275: ...MEMORY CONTROLLER S3C2501X 5 60 NOTES ...
Page 289: ...I2C CONTROLLER S3C2501X 6 14 NOTES ...
Page 373: ...GDMA CONTROLLER S3C2501X 9 24 NOTES ...
Page 435: ...I O PORTS S3C2501X 12 12 NOTES ...