![background image](http://html1.mh-extra.com/html/omron/cvm1d/cvm1d_operation-manual_742532377.webp)
0000
00
(161)
PUSH D00000
1000
0000
00
(162)
LIFO
D00000
2000
372
Example
When CIO 000000 is ON in the following example, PUSH(161) is used to write
the data in CIO 1000 to the 7-word stack from D00000 to D00006. The stack
pointer contains the memory address of D00002, so the data in CIO 1000 is co-
pied to D00002. The content of the stack pointer is then incremented from $2002
to $2003.
Address
Instruction
Operands
00000
LD
000000
00001
PUSH(161)
D00000
1000
D00000 $2006 (Final stack address)
$2000
D00001 $2002 (Stack pointer)
$2001
D00002 0000
$2002
D00003 0000
$2003
D00004 0000
$2004
D00005 0000
$2005
D00006 0000
$2006
ABCD
Stack pointer
incremented
D00000 $2006 (Final stack address)
$2000
D00001 $2003 (Stack pointer)
$2001
D00002 ABCD
$2002
D00003 0000
$2003
D00004 0000
$2004
D00005 0000
$2005
D00006 0000
$2006
1000
Memory
address
Memory
address
5-31-3 LAST IN FIRST OUT: LIFO(162)
(162)
LIFO TB1
D
D: Destination word
CIO, G, A, DM, DR, IR
TB1: 1
st
stack address CIO, G, A, DM
Operand Data Areas
Ladder Symbol
Variations
j
LIFO(162)
When the execution condition is OFF, LIFO(162) is not executed. When the ex-
ecution condition is ON, LIFO(162) decrements the memory address in the
stack pointer (TB1+1) by one, and then copies the data from the word indicated
by the stack pointer (the last written to the stack) to the destination word (D). The
stack pointer is the only word changed in the stack.
TB1 must be the first address of a stack defined using SSET(160).
Do not allow the stack pointer to be decremented to the memory address of the
stack pointer. If the content of the stack pointer is less than or equal to the ad-
dress of the stack pointer itself, the ER Flag (A50003) will be turned ON.
Note Refer to page 101 for general precautions on operand data areas.
Flags
ER (A50003):
Content of TB1+1 is less than or equal to the address of TB1+1.
Content of
*
DM word is not BCD when set for BCD.
Example
When CIO 000000 is ON in the following example, LIFO(162) is used to decre-
ment the content of the stack pointer from $2004 to $2003, and copy the last data
written to the stack to CIO 2000.
Address
Instruction
Operands
00000
LD
000000
00001
LIFO(162)
D00000
2000
Description
Precautions
Stack Instructions
Section 5-31
Summary of Contents for CVM1D
Page 462: ...SYSMAC CVM1D Duplex System Programmable Controllers Operation Manual Revised August 2001...
Page 463: ...iv...
Page 465: ...vi...