1. Program internal jump CJ/LBL

1. Program internal jump CJ/LBL

1.1. Instruction Description

The jump (CJ) instruction refers to the operation of a program to jump to the program branch specified by the tag (LBL). The tag LBL instruction is used in conjunction with the CJ instruction to identify the location of the jump.

Jump instructions can be used in the main program, subroutine, or interrupt program. The jump and corresponding label instructions must be located in the same section of program code (whether it is the main program, subroutine, or interrupt program). Cannot jump from the main program to a subroutine or interrupt program, nor can it jump out of a subroutine or interrupt program.

When accepting skip connections, the top value of the stack is always logic 1.

1.2. The valid operands of the instruction

1.2.1. jump instruction(CJ)

Input/Output Data Type operand Description
LBL 16 bit integer K/H Label

1.2.2. jump tags(LBL)

Input/Output Data Type operand Description
LBL 16 bit integer K/H tags

1.3. Example

command table:

NETWORK 000

LD X000

CJ K0 // If the top value of the stack is 1, jump to the K0 tag

NETWORK 001

LD X001

ADD D0 D1 D2 // If there is no jump above, D2=D0+D1 will be executed when the top of the stack is 1

NETWORK 002

LBL K0 // K0 tags

CJ11

图1 CJ11

CJ12

图2 CJ12