English
Language : 

MC68030 Datasheet, PDF (107/602 Pages) Motorola, Inc – ENHANCED 32-BIT MICROPROCESSOR
Instruction Set Summary
DINSERT
DILOOP
DIEMPTY
DIDONE
LEA
LEA
MOVE.L
MOVE.L
TST.L
BEQ
MOVE.L
CLR.L
MOVE.L
LEA
CAS2.L
BNE
BRA
MOVE.L
MOVE.L
CAS2.L
BNE
LIST_PUT, A0
LIST_GET, A1
A2, D2
(A0), D0
D0
DIEMPTY
D0, (NEXT, A2)
D1
D1, (LAST, A2)
(LAST, D0), A1
D0:D1,D2:D2,(A0):(A1)
DILOOP
DIDONE
D0, (NEXT, A2)
D0, (LAST, A2)
D0:D0,D2:D2,(A0):(A1)
DILOOP
(ALLOCATE NEW LIST ENTRY, LOAD ADDRESS INTO A2)
LOAD ADDRESS OF HEAD POINTER INTO A0
LOAD ADDRESS OF TAIL POINTER INTO A1
LOAD NEW ENTRY POINTER INTO D2
LOAD POINTER TO HEAD ENTRY INTO D0
IS HEAD POINTER NULL, (0 ENTRIES IN LIST)?
IF SO, WE NEED ONLY TO ESTABLISH POINTERS
PUT HEAD POINTER INTO FORWARD POINTER OF NEW ENTRY
PUT NULL POINTER VALUE INTO D1
PUT NULL POINTER IN BACKWARD POINTER OF NEW ENTRY
LOAD BACKWARD POINTER OF OLD HEAD ENTRY INTO A1
IF WE STILL POINT TO OLD HEAD ENTRY, UPDATE POINTERS
IF NOT, TRY AGAIN
PUT NULL POINTER IN FORWARD POINTER OF NEW ENTRY
PUT NULL POINTER IN BACKWARD POINTER OF NEW ENTRY
IF WE STILL HAVE NO ENTRIES, SET BOTH POINTERS TO THIS ENTRY
IF NOT, TRY AGAIN
SUCCESSFUL LIST ENTRY INSERTION
BEFORE INSERTING NEW ENTRY:
ENTRY
+ LAST + NEXT
ENTRY
+ LAST + NEXT
ENTRY
+ LAST + NEXT
NEW ENTRY
AFTER INSERTING NEW ENTRY:
ENTRY
+ LAST + NEXT
LIST_PUT
ENTRY
+ LAST + NEXT
LIST_GET
ENTRY
+ LAST + NEXT
LIST_PUT
Figure 3-4. Doubly Linked List Insertion
LIST_GET
When the list contains only one element, the routine branches to the CAS2 instruction at
label DDEMPTY after moving a zero pointer value into D2. This instruction checks the
addresses in LIST_PUT and LIST_GET to verify that no other routine has inserted another
element or deleted the last element. Then the instruction moves zero into both pointers, and
the list is empty.
MOTOROLA
MC68030 USER’S MANUAL
3-29