ADSP-BF53x/BF56x Blackfin Processor Programming Reference
4-43
Program Sequencer
into the
RETI
register prior to jumping to the event vector. A typical inter-
rupt service routine terminates with an
RTI
instruction that instructs the
sequencer to reload the Program Counter,
PC
, from the
RETI
register. The
following example shows a simple interrupt service routine.
isr:
[--SP] = (R7:0, P5:0);
/* push core registers */
[--SP] = ASTAT;
/* push arithmetic status */
/* place core of service routine here */
ASTAT = [SP++];
/* pop arithmetic status */
(R7:0, P5:0) = [SP++];
/* pop core registers */
RTI;
/* return from interrupt */
isr.end:
There is no need to manage the
RETI
register when interrupt nesting is not
enabled. If however, nesting is enabled and the respective service routine
must be interruptible by an interrupt of higher priority, the
RETI
register
must be saved, most likely onto the stack.
Instructions that access the
RETI
register do have an implicit site effect—
reading the
RETI
register enables interrupt nesting. Writing to it disables
nesting again. This enables the service routine to break itself down into
interruptible and non-interruptible sections. For example:
isr:
[--SP] = (R7:0, P5:0);
/* push core registers */
[--SP] = ASTAT;
/* push arithmetic status */
/* place critical or atomic code here */
[--SP] = RETI;
/* enable nesting */
/* place core of service routine here */
RETI = [SP++];
/* disable nesting */
/* more critical or atomic instructions */
ASTAT = [SP++];
/* pop arithmetic status */
(R7:0, P5:0) = [SP++];
/* pop core registers */
RTI;
/* return from interrupt */
isr.end:
Содержание 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...