Hitachi HIDIC MICRO-EH Applications Manual page 154

Table of Contents

Advertisement

Syntax of JMP, CJMP
1] LBL n with the same code number as the code
number n of the JMP instruction is required.
• If JMP 1 is executed when there
JMP 1
is no LBL 1, an LBL undefined
Program A
error occurs. JMP 1 will do
LBL 2
nothing and execute the next
Program B
processing of program A.
2] Jump is not permitted to outside the area in which the JMP
instruction resides.
Program head
JMP 1
Normal scan area
LBL 7
JMP 2
LBL 3
END
SB
JMP 3
LBL 2
Subroutine area
JMP 4
RTS
SB
LBL 4
JMP 5
Subroutine area
LBL 6
PTS
INTO
JMP 6
Interrupt scan area
LBL 5
JMP 7
LBL 1
RTI
3] Code number n of the JMP instruction and the LBL n with
the same code number may not be overlapped.
JMP 5
• In the pre-operation process, the
LBL 5
A]
label instructions A] and B] have 5
as the code numbers, so a duplicate
B] LBL 5
definition error will occur.
4] Nesting of JMP instructions is allowed.
JMP 0
JMP 1
JMP 2
LBL 1
LBL 0
JMP 3
LBL 2
JMP 4
LBL 3
LBL 4
5] The JMP instruction can jump to a location before the
instruction itself.
• JMP 0 will jump to LBL 0, which is a
location before the JMP instruction.
LBL 0
• When input X00000 turns on, the loop
CJMP1(X00000)
between LBL 0 and JMP 0 is escaped
JMP 0
by jumping from CJMP 1 (X00000) to
LBL 1.
LBL 1
• If there is no instruction as CJMP 1
(X00000) to escape from the loop, the
loop from LBL 0 to JMP 0 will
continue endlessly.
6] An overlap of JMP instructions with the same code
7] A startup condition can be programmed with respect to
• When the JMP 1 instruction
is executed, since LBL 1 is
not in the normal scan area,
a "jump outside the area"
error will be generated. The
JMP 1 instruction will do
nothing and execute the next
processing of program.
• JMP 2 to JMP 7 perform
similar processing.
8] The CJMP instruction also follows the same syntax as 1]
Note 1: When a JMP instruction jumps to LBL, the status
Note 2: If the JMP instruction is used in conjunction with
Note 3: Do not create a circuit that jumps to outside from
5-104
Chapter 5 Instruction Specifications
number is valid.
JMP 5
JMP 5
CJMP 5
LBL 5
JMP instructions.
Startup condition
X00000 X00001
X00002
JMP 0
Program A
Program B
X00003
Program C
LBL 0
through 7].
of each I/O between JMP and LBL is retained.
However, the timer progress value will be updated.
X00000
JMP 1
TD0
X00001
0.1s
100
LBL 1
the MCS or MCR instruction, the following actions
will result, so exercise caution when programming.
X00000
JMP 1
• When JMP 2 does not
Program
MCS0
X00001
Program
LBL 2
Y00100
X00002
MCR0
between MCS and MCR.
• If a jump is performed
from JMP 0 to LBL 0,
programs A, B and C
will not be executed.
• If X00000 turns on after
X00001 turns on, the
progress value of TD0 will
be updated even if a jump
is performed from JMP 1
to LBL 1. If X00000
remains on, TD0 will not
turn on even if its progress
value exceeds 100.
jump, Y00100 will turn on
when X00001 and X00002
are both on.
When JMP 2 does jump, if
X00000 is on, Y00100 will
follow the on/off of
X00002 regardless of the
on/off of X00001.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents