244
Data Movement Instructions Section 5-17
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).
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) copies the content of
DM 0005 (DM 0000 + 5) to IR 001. The content of the stack pointer (DM 0000)
is then decremented by one.
Flags ER: The offset or stack length in the control word is not BCD.
Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
@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
@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 8005
DM 0000 0004
DM 0001 AAAA
DM 0002 BBBB
DM 0003 CCCC
DM 0004 DDDD
DM 0005 EEEE
IR 001 EEEE