A-45
Appendices
CJ2 CPU Unit Software User’s Manual
A-1 Instruction Functions
App
A-1-15 Table Data Processing Instructions
A-1-15 Table Data Processing Instructions
Instruction Mnemonic Code Symbol/Operand Function Location
Execution
condition
SET STACK SSET
@SSET
630 Output Required
PUSH ONTO
STACK
PUSH
@PUSH
632 Output Required
LAST IN
FIRST OUT
LIFO
@LIFO
634 Output Required
FIRST IN
FIRST OUT
FIFO
@FIFO
633 Output Required
DIMENSION
RECORD
TABLE
DIM
@DIM
631 Output Required
SSET(630)
TB
N
TB: 1st stack
address
N: Number of words
TB
TB+1
TB+2
TB+3
m+(N−1)
m+(N−1)
Stack
pointer
Last
word in
stack
N words
in stack
Internal I/O
memory address
Defines a stack of the specified length beginning at the
specified word and initializes the words in the data region
to all zeroes.
PUSH(632)
TB
S
TB: 1st stack
address
S: Source word
PUSH(632)
TB
TB+1
TB+2
TB+3
TB
TB+1
TB+2
TB+3
Internal I/O
memory
address
Internal I/O
memory
address
Writes one word of data to the specified stack.
LIFO(634)
TB
D
TB: 1st stack
address
D: Destination
word
TB
TB+1
TB+2
TB+3
m−
1
TB
TB+1
TB+2
TB+3
m−1
m−1
Last-in first-out
The pointer is
decremented.
A is left
un-changed.
Stack
pointer
Newest
data
Internal I/O
memory address
Internal I/O
memory address
Stack
pointer
Reads the last word of data written to the specified stack
(the newest data in the stack).
FIFO(633)
TB
D
TB: 1st stack
address
D: Destination
word
TB
TB+1
TB+2
TB+3
TB
TB+1
TB+2
TB+3
m−1
m−1
First-in first-out
Stack
pointer
Stack
pointer
Oldest
data
Internal I/O
memory address
Internal I/O
memory address
Reads the first word of data written to the specified stack
(the oldest data in the stack).
DIM(631)
N
LR
NR
TB
N: Table number
LR: Length of
each record
NR: Number of
records
TB: 1st table word
Number
of records
Record NR
Record 1
Defines a record table by declaring the length of each
record and the number of records. Up to 16 record tables
can be defined.
Table number (N)
LR
×
NR words