7-17
Section
Data Movement Instructions
416
Example
The following example shows how to use DIST(80) to copy #00FF to HR 10 + Of.
The content of LR 10 is #3005, so #00FF is copied to HR 15 (HR 10 + 5) when
IR 00000 is ON.
@DIST(80)
#00FF
HR 10
LR 10
00000
Address
Instruction
Operands
00000
LD
00000
00001
@DIST(80)
#
00FF
HR
10
LR
10
F
#00FF
0 0 F
0
HR 10
0 0 0
F
HR 15
0 0 F
5
LR 10
3 0 0
Stack Operation
When bits 12 to 15 of C=9, DIST(80) can be used for a stack operation. The other
3 digits of C specify the number of words in the stack (000 to 999 in BCD). The
content of DBs is the stack pointer.
When the execution condition is OFF, DIST(80) is not executed. When the
execution condition is ON, DIST(80) copies the content of S to DBs+1+the con-
tent of DBs. In other words, 1 and the content of DBs are added to DBs to deter-
mine the destination word. The content of DBs is then incremented by 1.
Note
1. DIST(80) will be executed every cycle unless the differentiated form
(@DIST(80)) is used or DIST(80) is used with DIFU(13) or DIFD(14).
2. Be sure to initialize the stack pointer before using DIST(80) as a stack op-
eration.
Example
The following example shows how to use DIST(80) to create a stack between
DM 0001 and DM 0005. DM 0000 acts as the stack pointer.
@DIST(80)
200
DM 0000
216
00000
Address
Instruction
Operands
00000
LD
00000
00001
@DIST(80)
200
DM
0000
216
DM 0000
0000
DM 0001
0000
DM 0002
0000
DM 0003
0000
DM 0004
0000
DM 0005
0000
Stack pointer
incremented
First execution
DM 0000
0001
DM 0001
FFFF
DM 0002
0000
DM 0003
0000
DM 0004
0000
DM 0005
0000
Stack pointer
incremented
Second
execution
IR 200
FFFF
IR 216
9005
DM 0000
0002
DM 0001
FFFF
DM 0002
FFFF
DM 0003
0000
DM 0004
0000
DM 0005
0000
Flags
ER:
The offset or stack length in the control word is not BCD.
Indirectly
addressed DM word is non-existent. (Content of
*
DM word is
not BCD, or the DM area boundary has been exceeded.)