Motorola CPU32 Bedienungsanleitung Seite 70

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 646
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 69
Addressing Capabilities
MOTOROLA M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL 2-29
To implement stack growth from low memory to high memory, use (An) + to push data on
the stack and -(An) to pull data from the stack. After either a push or pull operation, the
address register points to the next available space on the stack. .
2.6.2 Queues
The user can implement queues, groups of information waiting to be processed, with the
address register indirect with postincrement or predecrement addressing modes. Using a
pair of address registers, the user implements a queue that fills either from high memory to
low memory or from low memory to high memory. Two registers are used because the
queues get pushed from one end and pulled from the other. One address register contains
the put pointer; the other register the get pointer. To implement growth of the queue from low
memory to high memory, use the put address register to put data into the queue and the get
address register to get data from the queue.
After a put operation, the put address register points to the next available space in the
queue; 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; the unchanged put address register points to the next available space in the
queue. .
To implement the queue as a circular buffer, the relevant address register should be checked
and adjusted. If necessary, do this before performing the put or get operation. Subtracting
the buffer length (in bytes) from the register adjusts the address register. To implement
growth of the queue from high memory to low memory, use the put address register indirect
to put data into the queue and get address register indirect to get data from the queue.
BOTTOM OF STACK
LOW MEMORY
TOP OF STACK
(FREE)
HIGH MEMORY
An
GET (Am) +
PUT (An) +
HIGH MEMORY
LOW MEMORY
(FREE)
LAST GET (FREE)
NEXT GET
LAST PUT
Seitenansicht 69
1 2 ... 65 66 67 68 69 70 71 72 73 74 75 ... 645 646

Kommentare zu diesen Handbüchern

Keine Kommentare