3. Instructions
550
CS/CJ/NSJ Series Instructions Reference Manual (W474)
z 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.
z LIFO(634)
Reads the last (most recent) word of data that was stored in the stack. Decrements the pointer by one
and reads the data at this address (the most recent data stored in the stack). The read data will not be
cleared.
To learn the number of data words in a stack, use an SNUM instruction.
Example: Learning the number of items on a conveyor
To read (reference), change (refresh), insert, or delete a data word within the stack, use SREAD,
SWRIT, SINS, and SDEL commands, respectively.
Example: To track items moving on a conveyor, treat the stack words as the items and manage
additions, discharges, and changes of the items
to
to
Data region Data region
Stack Stack
Pointer to last
word in stack
Pointer
Reads the content of A, decrements the pointer
by 1, deletes A, and shifts remaining data down.
Pointer
Pointer
A
B
A
B
Data region
Pointer
Stack
A is the last word
stored in the stack.
Pointer
Stack
Data region
Decrements the pointer by one
and reads content of A.