276
Data Movement Instructions
Section 5-18
Note
COLL(81) will be executed every cycle unless the differentiated form
(@COLL(81)) is used or COLL(81) is used with DIFU(13) or DIFD(14).
Example
The following example shows how to use COLL(81) to create a stack between
DM 0001 and DM 0005. DM 0000 acts as the stack pointer.
When IR 00000 goes from OFF to ON, COLL(81) shifts the contents of DM
0002 to DM 0005 down by one address, and shifts the data from DM 0001 to
IR 001. The content of the stack pointer (DM 0000) is then decremented by
one.
LIFO Stack Operation
When bits 12 to 15 of C=8, COLL(81) can be used for an LIFO stack opera-
tion. The other 3 digits of C specify the number of words in the stack (000 to
999). The content of SBs is the stack pointer.
When the execution condition is ON, COLL(81) copies the data from the word
indicated by the stack pointer (SBs+the content of SBs) to the destination
word (D). The content of the stack pointer (SBs) is then decremented by one.
The stack pointer is the only word changed in the stack.
Note
COLL(81) will be executed every cycle unless the differentiated form
(@DIST(80)) is used or DIST(80) is used with DIFU(13) or DIFD(14).
@COLL(81)
DM 0000
216
001
00000
Address
Instruction
Operands
00000
LD
00000
00001
@COLL(81)
DM
0000
216
001
DM 0000
0005
DM 0001
AAAA
DM 0002
BBBB
DM 0003
CCCC
DM 0004
DDDD
DM 0005
EEEE
Stack pointer
decremented
IR 216
9005
DM 0000
0004
DM 0001
BBBB
DM 0002
CCCC
DM 0003
DDDD
DM 0004
EEEE
DM 0005
EEEE
IR 001
AAAA