ADSP-BF53x/BF56x Blackfin Processor Programming Reference
4-15
Program Sequencer
[--SP] = RETS; /* save RETS onto stack */
CALL function_b; /* call further subroutines */
CALL function_c;
RETS = [SP++]; /* restore RETS */
(R7:7, P5:5) = [SP++]; /* optional multiple pop instruction */
RTS; /* return from subroutine */
function_a.end: /* closing subroutine label */
function_b:
/* do something */
RTS;
function_b.end:
function_c:
/* do something else */
RTS;
function_c.end:
Stack Variables and Parameter Passing
Many subroutines require input arguments from the calling function and
need to return their results. Often, this is accomplished by project-wide
conventions, that certain core registers are used for passing arguments,
where others return the result. It is also recommended that assembly pro-
grams meet the conventions used by the C/C++ compiler. See the
Vi+ C/C++ Compiler and Library Manual for details.
Extensive arguments are typically passed over the stack rather than by reg-
isters. The following example passes and returns two 32-bit arguments:
_parent:
...
R0 = 1;
R1 = 3;
[--SP] = R0;
[--SP] = R1;
Содержание ADSP-BF53x Blackfin
Страница 38: ...Conventions xxxviii ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 134: ...System Reset and Powerup 3 18 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 324: ...Instruction Overview 7 20 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 486: ...Instruction Overview 13 28 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 512: ...Instruction Overview 14 26 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 604: ...Instruction Overview 15 92 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 688: ...Instruction Overview 18 48 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 742: ...Instruction Overview 19 54 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 752: ...Examples 20 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 780: ...Product Identification Register 21 28 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 790: ...ADSP BF535 Flags A 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 800: ...Performance Monitor Registers B 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 994: ...Instructions Listed By Operation Code C 194 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 1042: ...Index I 40 ADSP BF53x BF56x Blackfin Processor Programming Reference...