Motorola DSP96002 User Manual

Page 51

Advertising
background image

4 - 12

DSP96002 USER’S MANUAL

MOTOROLA

UF SE P3 P2 P1 P0 Description

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. Double pull causes underflow.

0

0

0

0

1

0

Stack location 2.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

0

0

1

1

0

1

Stack location 13.

0

0

1

1

1

0

Stack location 14. Double push causes overflow.

0

0

1

1

1

1

Stack location 15. (Stack full). Push causes overflow.

0

1

0

0

0

0

Stack overflow condition.

0

1

0

0

0

1

Stack overflow condition after double push.

Figure 4-5. Stack Pointer Values

Data is pushed onto the stack by incrementing SP by one then writing the item at the new stack location SP.

An item is pulled off the stack by copying it from location SP and then decrementing SP by one. Move in-

structions that read the SSH implicitly decrement the SP, and move instructions that write the SSH implicitly

increment the SP. This facilitates managing the stack under software control. Since each location that the

stack points to is 64 bits wide, it must be accessed by two move instructions. The first move should be to/

from the SSL and then the second move should be to/from the SSH to automatically trigger a SP increment/

decrement.

4.11.2

Stack Error flag (SE) Bit 4

The Stack Error flag (SE) indicates that a stack error has occurred. The transition of SE from 0 to 1 causes

the priority level 3 Stack Error exception (see Section 8).

When the stack is completely full, the Stack Pointer reads 001111, and any operation that pushes data to

the stack will cause a stack error exception to occur and the stack register will read 010000 (or 010001 if

an implied double push occurs).

Any implied pull operation with SP=0 will cause a Stack Error exception (see Section 8), and the SP will

read all ones (or 111110 if an implied double pull occurs). As shown in Figure 4-5, the SE bit is set.

Once set, the SE flag remains so until a move or bit instruction that directly references the Stack Pointer

explicitly clears the SE flag. The SE flag is also cleared by hardware reset. When SP=0 (stack empty), no

stack level is selected. Instructions which read the stack without SP post-decrement (REP SSL, MOVEC

when SSL is specified as source, etc.) do not cause a stack error exception and the data read will be inde-

terminate. Instructions which write the stack without SP pre-increment (MOVEC when SSL is specified as

destination, etc.) do not cause a stack error exception and no stack registers are altered.

Advertising