S5-100U
Processing Jump Operations
A symbolic jump destination (jump label) must always be entered next to a jump operation. This
jump label can have up to four characters. The first character must be a letter of the alphabet.
When programming, please be aware of the following items:
•
The absolute jump displacement cannot exceed +127 or - 128 words in the program memory.
Some statements take up two words (e.g., "Load a constant"). For long jumps, insert an inter-
mediate destination.
•
Jumps can be executed only within a block.
•
Jumping over segment boundaries ("BLD 255") is not permitted.
•
Jump labels can be set only at the start of a series of scans for CPU 102.
Example
If no bit of input word IW1 is
set, program scanning jumps to
the label "AN 1". If input word
IW1 and output word QW3 do
not agree, program processing
jumps back to the label "AN 0".
Otherwise input word IW1 and
data word DW12 are compared.
If input word IW1 is greater than
or less than data word DW12,
program scanning jumps to the
"DEST" label.
1
The "L..." statement does not affect the condition codes. An addition (+F) is executed with the constant
0000
so that the "JZ" operation can evaluate the contents of the accumulator.
H
EWA 4NEB 812 6120-02b
STL
AN0
:L
IW 1
:L
KH 0000
:+F
:JZ=
AN 1
:A
I 0.0
.
.
.
.
.
.
AN1
:L
IW 1
:L
QW 3
:XOW
:JN = AN 0
:L
IW 1
:L
DW12
:><
F
:JC = DEST
.
.
.
.
.
DEST
:A
I 0.1
.
.
STEP 5 Operations
Explanation
Load input word IW1 into
ACCU 1. If the contents of
1
ACCU 1 equal zero
, jump to
the label "AN 1". Otherwise
process the next statement
(I 0.0).
Compare input word IW1 and
output word QW3. If they are
not equal, set individual bits in
ACCU 1.
If the contents of ACCU 1 are
not zero, jump to the label
"AN 0". Otherwise process the
next statements.
Compare input word IW1 and
data word DW12. If they are
not equal, set RLO to "1".
If the RLO = "1", jump to the
"DEST" label. If the RLO =
"0", process the next
statement.
8-57