PROGRAMMING MODEL
5 - 16
PROGRAM CONTROL UNIT
MOTOROLA
these bits are cleared (SP=0), indicating that the SS is empty.
Data is pushed onto the SS by incrementing the SP, then writing data to the location to
which the SP points. An item is pulled off the stack by copying it from that location and
then by decrementing the SP.
5.4.5.2
Stack Error Flag (Bit 4)
The stack error flag indicates that a stack error has occurred, and the transition of the
stack error flag from zero to one causes a priority level-3 stack error exception.
When the stack is completely full, the SP reads 001111, and any operation that pushes
data onto the stack will cause a stack error exception to occur. The SR will read 010000
(or 010001 if an implied double push occurs).
Any implied pull operation with SP equal to zero will cause a stack error exception, and
the SP will read 111111 (or 111110 if an implied double pull occurs).
The stack error flag is a “sticky bit” which, once set, remains set until cleared by the user.
There is a sequence of instructions that can cause a stack overflow and, without the sticky
bit, would not be detected because the stack pointer is decremented before the stack error
interrupt is taken. The sticky bit keeps the stack error bit set until the user clears it by writ-
ing a zero to SP bit 4. It also latches the overflow/underflow bit so that it cannot be
changed by stack pointer increments or decrements as long as the stack error is set. The
overflow/underflow bit remains latched until the first move to SP is executed.
Note:
When SP is zero (stack empty), instructions that read the stack without SP post-
decrement and instructions that write to the stack without SP preincrement do not cause
a stack error exception (i.e., 1) DO SSL,xxxx 2) REP SSL 3) MOVEC or move peripheral
Figure 5-8 SP Register Values
UF SE
P3
P2 P1 P0
1
1
1
1
1
0
STACK UNDERFLOW CONDITION AFTER DOUBLE PULL
1
1
1
1
1
1
STACK UNDERFLOW CONDITION
0
0
0
0
0
0
STACK EMPTY (RESET); PULL CAUSES UNDERFLOW
0
0
0
0
0
1
STACK LOCATION 1
0
0
1
1
1
0
STACK LOCATION 14
0
0
1
1
1
1
STACK LOCATION 15; PUSH CAUSES OVERFLOW
0
1
0
0
0
0
STACK OVERFLOW CONDITION
0
1
0
0
0
1
STACK OVERFLOW CONDITION AFTER DOUBLE PUSH
Содержание DSP56K
Страница 12: ...xii LIST of TABLES MOTOROLA List of Tables Continued Table Page Number Title Number ...
Страница 13: ...MOTOROLA DSP56K FAMILY INTRODUCTION 1 1 SECTION 1 DSP56K FAMILY INTRODUCTION ...
Страница 25: ...MOTOROLA DSP56K CENTRAL ARCHITECTURE OVERVIEW 2 1 SECTION 2 DSP56K CENTRAL ARCHITECTURE OVERVIEW ...
Страница 31: ...MOTOROLA DATA ARITHMETIC LOGIC UNIT 3 1 SECTION 3 DATA ARITHMETIC LOGIC UNIT ...
Страница 50: ...DATA ALU SUMMARY 3 20 DATA ARITHMETIC LOGIC UNIT MOTOROLA ...
Страница 51: ...MOTOROLA ADDRESS GENERATION UNIT 4 1 SECTION 4 ADDRESS GENERATION UNIT ...
Страница 77: ...MOTOROLA PROGRAM CONTROL UNIT 5 1 SECTION 5 PROGRAM CONTROL UNIT ...
Страница 124: ...INSTRUCTION GROUPS 6 30 INSTRUCTION SET INTRODUCTION MOTOROLA ...
Страница 125: ...MOTOROLA PROCESSING STATES 7 1 SECTION 7 PROCESSING STATES STOP WAIT EXCEPTION NORMAL RESET ...
Страница 167: ...STOP PROCESSING STATE MOTOROLA PROCESSING STATES 7 43 ...
Страница 168: ...STOP PROCESSING STATE 7 44 PROCESSING STATES MOTOROLA ...
Страница 169: ...MOTOROLA PORT A 8 1 SECTION 8 PORT A ...
Страница 176: ...PORT A INTERFACE 8 8 PORT A MOTOROLA ...
Страница 177: ...MOTOROLA PLL CLOCK OSCILLATOR 9 1 SECTION 9 PLL CLOCK OSCILLATOR x x d Φ VCO ...
Страница 191: ...10 2 ON CHIP EMULATION OnCE MOTOROLA SECTION 10 ON CHIP EMULATION OnCE ...
Страница 218: ...USING THE OnCE MOTOROLA ON CHIP EMULATION OnCE 10 29 ...
Страница 604: ...INSTRUCTION ENCODING A 338 INSTRUCTION SET DETAILS MOTOROLA ...
Страница 605: ...MOTOROLA BENCHMARK PROGRAMS B 1 APPENDIX B BENCHMARK PROGRAMS T T T T T P1 P3 P2 P4 T T T ...
Страница 606: ...SECTION CONTENTS B 2 BENCHMARK PROGRAMS MOTOROLA SECTION B 1 INTRODUCTION 3 SECTION B 2 BENCHMARK PROGRAMS 3 ...
Страница 609: ...BENCHMARK PROGRAMS MOTOROLA BENCHMARK PROGRAMS B 5 ...
Страница 611: ...BENCHMARK PROGRAMS MOTOROLA BENCHMARK PROGRAMS B 7 ...
Страница 613: ...BENCHMARK PROGRAMS MOTOROLA BENCHMARK PROGRAMS B 9 ...
Страница 615: ...BENCHMARK PROGRAMS MOTOROLA BENCHMARK PROGRAMS B 11 ...