3. Instructions
552
CS/CJ/NSJ Series Instructions Reference Manual (W474)
z SINS(641)
Inserts the source data at the specified location in the stack and shifts the rest of the data in the stack
downward. The offset value indicates the location of the desired word (the number of words before the
current pointer position).
z SDEL(642)
Deletes the data element at the specified location in the stack and shifts the rest of the data in the stack
upward. The offset value indicates the location of the desired word (the number of words before the
current pointer position).
M
:
A
B
C
:
M
A
B
C
Stack
Data region
Pointer
Pointer
(Incremented by 1)
Last word of
data in stack
Stack
Data region
Pointer to last
word in stack
Data in pointer position - n
(n=3 in this example.)
Pointer
Inserts data element M at pointer
position - n, shifts the existing data
(A, B, and C) down, and increments
the pointer value by 1.
Pointer to last
word in stack
Pointer
-n
(n=3)
Insert
Data in pointer
position n
A
:
A
B
C
:
B
C
C
Stack
Data
region
Pointer
Pointer
(Decre-
mented by 1)
Last word of
data in stack
Stack
Data region
Pointer to last
word in stack
Data in pointer position - n
(n=3 in this example.)
Pointer
Deletes the data element at pointer
position - n, shifts the remaining
data upward, and decrements the
pointer value by 1.
Pointer to last
word in stack
Pointer
-n
(n=3)