![Omron CJ1G-CPUxx Instructions Manual Download Page 640](http://html1.mh-extra.com/html/omron/cj1g-cpuxx/cj1g-cpuxx_instructions-manual_742491640.webp)
619
Table Data Processing Instructions
Section 3-17
The following diagram shows the basic structure of a stack.
The following instructions define or act on stack regions. Basically,
PUSH(632) stores data in the next available data word in the stack. FIFO(633)
and LIFO(634) read data from the stack. FIFO(633) reads the first word that
was stored, while LIFO(634) reads the last word that was stored.
The last five instructions are supported by CS1-H, CJ1-H, CJ1M, and CS1D
CPU Units only. SNUM(638) counts the number of data elements (words) in
the specified stack; for example, this instruction could be used to indicate the
number of items on a conveyor. Use the SREAD(639), SWRIT(640),
SINS(641), and SDEL(642) instructions to read, overwrite, insert, and delete
data elements in a stack. For example, when items are being handled on a
conveyor, these instructions can add, remove, or change a data element in
the stack that corresponds to an item on the conveyor.
PUSH(632)
Stores data in the address indicated by the stack pointer and increments the
pointer by one.
FIFO(633)
Reads first (oldest) word of data that was stored in the stack, shifts the
remaining data down one word, and decrements the pointer by one.
PC memory address of the
last word in the stack
PC memory address of the
next data word (stack pointer)
Stack region
Words in
stack region
Data region
End of
stack
Stack region
Pointer
PC memory
address
16 words
Example
P
o
inter
Stack
Pointer
Stack
Pointer
A
to
to
Stack
Pointer
Stack
Pointer
Pointer to last
word in stack
Reads the content of A, decrements the pointer
by 1, deletes A, and shifts remaining data down.
Data region
Data region
Pointer
Summary of Contents for CJ1G-CPUxx
Page 3: ...iv N o t i c e ...
Page 5: ...vi ...
Page 21: ...xxii Conformance to EC Directives 6 ...
Page 35: ......
Page 1131: ...1110 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...