Introduction
Labels serve as destinations for Jumps.
Label Properties:
Label properties:
Labels must always be the first element in a line.
The name must be clear throughout the directory, and it is not upper/lower case sensitive.
Labels can be 256 characters long (max.).
Labels must conform to the IEC name conventions.
Labels are separated by a colon
:
from the following instruction.Labels are only permitted at the beginning of "Expressions", otherwise an undefined value can be found in the battery.
Example:
start: LD A AND B OR C ST D JMP start
Jump Properties:
Jump properties:
With
JMP
operation a jump to the label can be restricted or unrestricted.JMP
can be used with the modifiersC
andCN
(only if the battery content is data typeBOOL
).Jumps can be made within program and DFB sections.
Jumps are only possible in the current section.
Possible destinations are:
the first
LD
instruction of an EFB/DFB call with assignment of input parameters (seestart2
),a normal
LD
instruction (seestart1
),a
CAL
instruction, which does not work with assignment of input parameters (seestart3
),a
JMP
instruction (seestart4
),the end of an instruction list (see
start5
).
Example
start2: LD A
ST counter.CU
LD B
ST counter.R
LD C
ST counter.PV
CAL counter
JMPCN start4
start1: LD A
AND B
OR C
ST D
JMPC start3
LD A
ADD E
JMP start5
start3: CAL counter (
CU:=A
R:=B
PV:=C )
JMP start1
LD A
OR B
OR C
ST D
start4: JMPC start1
LD C
OR B
start5: ST A