Analog Devices ADSP-BF53x Blackfin Reference page 151

Table of Contents

Advertisement

The Blackfin instruction set features a pair of instructions that provides
cleaner and more efficient functionality than the above example: the
and
instructions. These multi-cycle instructions perform multiple
UNLINK
operations that can be best explained by the equivalent code sequences:
Table 4-3. Link and Unlink Code Sequencer
LINK n;
[--SP] = RETS;
[--SP] = FP;
FP = SP;
SP += -n;
The following subroutine does the same job as the one above, but it also
saves the
RETS
value stored to
is required, the
_sub2:
LINK 0;
[--SP] = (R7:5);
R6 = [FP+8];
R7 = [FP+12];
R5 = R6 + R7;
R6 = R6 - R7;
[FP+8] = R5;
[FP+12] = R6;
(R7:5) = [SP++];
UNLINK;
RTS;
_sub2.end:
ADSP-BF53x/BF56x Blackfin Processor Programming Reference
register to enable nested subroutine calls. Therefore, the
is 8 bytes off the original
FP
instruction gets the parameter "0".
LINK
/* R6 = 3 */
/* R7 = 1 */
/* R5 = 4 */
/* R6 = 2 */
Program Sequencer
UNLINK;
SP = FP;
FP = [SP++];
RETS = [SP++];
value. Since no local frame
SP
LINK
4-17

Advertisement

Table of Contents
loading

This manual is also suitable for:

Adsp-bf56x blackfin

Table of Contents