English
Language : 

MC68030 Datasheet, PDF (77/602 Pages) Motorola, Inc – ENHANCED 32-BIT MICROPROCESSOR
Data Organization and Addressing Capabilities
In this case, after either a push or pull operation, register An points to the next available
space on the stack. This is illustrated as:
LOW MEMORY
BOTTOM OF STACK
TOP OF STACK
An
(FREE)
HIGH MEMORY
2.8.3 Queues
The user can implement queues with the address register indirect with postincrement or
predecrement addressing modes. Using a pair of address registers (who of A0–A6), the user
can implement a queue which is filled either from high to low memory or from low to high
memory. Two registers are used because queues are pushed from one end and pulled from
the other. One register, An, contains the "put'' pointer; the other, Am, the "get'' pointer.
To implement growth of the queue from low to high memory, use:
(An)+ to put data into the queue,
(Am)+ to get data from the queue.
After a "put'' operation, the "put'' address register points to the next available space in the
queue, and the unchanged "get'' address register points to the next item to be removed from
the queue. After a "get'' operation, the "get'' address register points to the next item to be
removed from the queue, and the unchanged "put'' address register points to the next
available space in the queue. This is illustrated as:
GET (Am) +
LOW MEMORY
LAST GET (FREE)
NEXT GET
PUT (An) +
LAST PUT
(FREE)
HIGH MEMORY
To implement the queue as a circular buffer, the relevant address register should be
checked and adjusted, if necessary, before performing the "put'' or "get'' operation. The
address register is adjusted by subtracting the buffer length (in bytes) from the register.
MOTOROLA
MC68030 USER’S MANUAL
2-39