|
MC68030 Datasheet, PDF (76/602 Pages) Motorola, Inc – ENHANCED 32-BIT MICROPROCESSOR | |||
|
◁ |
Data Organization and Addressing Capabilities
2.8.2 User Program Stacks
The user can implement stacks with the address register indirect with postincrement and
predecrement addressing modes. With address register An (n = 0â6), the user can
implement a stack that is filled wither from high to low memory or from low to high memory.
Important considerations are:
⢠Use the predecrement mode to decrement the register before its contents are used as
the pointer to the stack.
⢠Use the postincrement mode to increment the register after its contents are used as the
pointer to the stack.
⢠Maintain the stack pointer correctly when byte, word, and long-word items are mixed in
these stacks.
To implement stack growth from high to low memory, use:
â(An) to push data on the stack,
(An)+ to pull data from the stack.
For this type of stack, after either a push or a pull operation, register An points to the top item
on the stack. This is illustrated as:
LOW MEMORY
An
(FREE)
TOP OF STACK
BOTTOM OF STACK
HIGH MEMORY
To implement stack growth from low to high memory, use:
(An)+ to push data on the stack,
âAn to pull data from the stack.
2-38
MC68030 USERâS MANUAL
MOTOROLA
|
▷ |