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:
Summary of Contents for ADSP-BF53x Blackfin
Page 38: ...Conventions xxxviii ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 134: ...System Reset and Powerup 3 18 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 324: ...Instruction Overview 7 20 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 486: ...Instruction Overview 13 28 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 512: ...Instruction Overview 14 26 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 604: ...Instruction Overview 15 92 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 688: ...Instruction Overview 18 48 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 742: ...Instruction Overview 19 54 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 752: ...Examples 20 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 790: ...ADSP BF535 Flags A 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 800: ...Performance Monitor Registers B 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 1042: ...Index I 40 ADSP BF53x BF56x Blackfin Processor Programming Reference...