Queues - Motorola MC68030 User Manual

Enhanced 32-811 microprocessor
Hide thumbs Also See for MC68030:
Table of Contents

Advertisement

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
BonOM OF STACK
' 7
' 7
~
~
TOP OF STACK
An
---.
(FREE)
HIGH MEMORY
2.8.3
Queues
The user can implement queues with the address register indirect with post-
increment or predecrement addressing modes. Using a pair of address reg-
isters (two of AO-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:
LOW MEMORY
LAST GET (FREE)
GET (Am)+
---.
NEXT GET
' 7
'7
L
L
LAST PUT
PUT (An)+
---.
(FREE)
HIGH MEMORY
MOTOROLA
MC68030 USER'S MANUAL
2-39
l1li

Advertisement

Table of Contents
loading

Table of Contents