EasyManua.ls Logo

FATEK FBs-CB2 - STACK (FUN111 STACK)

FATEK FBs-CB2
348 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Advanced Function Instruction
7-96
FUN111 D P
STACK
STACK
FUN111 D P
STACK
IW : Data pushed into stack, can be a constant
or a register
ST : Starting register of stack
L : Size of stack
Pr : Pointer register
OW : Register accepting data popped out from
stack
ST may combine with V, Z, P0~P9 to serve
indirect address application
WX WY WM WS TMR CTR HR IR OR SR ROR DR K XR
Range
Ope-
rand
WX0
WX240
WY0
WY240
WM0
WM1896
WS0
WS984
T0
T255
C0
C255
R0
R3839
R3840
R3903
R3904
R3967
R3968
R4167
R5000
R8071
D0
D4095
16/32-bit
+/-
number
VZ
P0~P9
IW
ST * *
L * 2~256
Pr * *
OW * *
z Like queue, stack is also a kind of table. The nature of its pointer is exactly the same as with queue, i.e. Pr = 1
to L, which corresponds to ST
1
to ST
L
, and when Pr = 0 the stack is empty.
z Stack is the opposite of queue, being a last in first out (LIFO) device. This means that the data that was most
recently pushed into the stack will be the first to be popped out of the stack. The stack is comprised of L
consecutive 16 or 32-bit ( D instruction) registers starting from ST, as shown in the following diagram:
Pr
4
cg is the sequence
number of operation
ST
ST1
c1111
Bottom of stack
ST2
d2222
ST3
e3333
IW ST4
f4444
OW
g5555
ST5
××××
push
STL
z When execution control "EN" = 1 or "EN" ( P instruction) has a transition from 0 to 1, the status of in/out
control "I/O" determines whether the IW data will be pushed into the stack (when "I/O" = 1), or the data pointed
by Pr within the stack (the data most recently pushed into the stack) will be moved out and transferred to OW
(when "I/O" = 0). Note that the data pushed in is stacking, so before pushed in, Pr will increased by 1 to point
to the top of the stack then the data will be pushed in. When it is popped out, the data pointed by pointer Pr
(the most recently pushed in data) will be transferred to OW. After then Pr will decreased by 1. Under any
circumstances, the pointer Pr will always point to the data that was pushed into the stack most recently.
push(I/O=1)
1.Pr1Pr
2.IWSTpr
pop(I/O=0)
1.STprOW
2.P
r
1
P
r

Other manuals for FATEK FBs-CB2

Related product manuals