ITER(迭代)

代码 因子1 因子2 结果字段 指标
热核实验堆            

ITER 操作将控制从 DO 或 FOR 组中转移到该组的 ENDDO 或 ENDFOR 语句。 它可以在 DO , DOU , DOUxx , DOW , DOWxx 和 FOR 循环中使用,以将控制立即传输到循环的 ENDDO 或 ENDFOR 语句。 它会导致循环的下一次迭代立即执行。 ITER 会影响最内部的循环。

如果在传递了控制的 ENDDO 或 ENDFOR 语句上存在条件指示符,并且不满足条件,那么在 ENDDO 或 ENDFOR 操作之后继续处理该语句。

LEAVE (离开 "待办事宜"/"组") 操作类似于 ITER 操作; 但是, LEAVE 将控制转移到语句 追随 ENDDO 或 ENDFOR 操作。

有关更多信息,请参阅 分支操作结构化编程操作

图 1。 ITER 操作
*...1....+....2....+....3....+....4....+....5....+....6....+....7....+....
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
 *
 * The following example uses a DOU loop containing a DOW loop.
 * The IF statement checks indicator 01.  If indicator 01 is ON,
 * the LEAVE operation is executed, transferring control out of
 * the innermost DOW loop to the Z-ADD instruction.  If indicator
 * 01 is not ON, subroutine PROC1 is processed.  Then indicator
 * 12 is checked.  If it is OFF, ITER transfers control to the
 * innermost ENDDO and the condition on the DOW is evaluated
 * again.  If indicator 12 is ON, subroutine PROC2 is processed.
C
C                   DOU       FLDA = FLDB
C                   :
C     NUM           DOWLT     10
C                   IF        *IN01
C                   LEAVE
C                   ENDIF
C                   EXSR      PROC1
C     *IN12         IFEQ      *OFF
C                   ITER
C                   ENDIF
C                   EXSR      PROC2
C                   ENDDO
C                   Z-ADD     20            RSLT              2 0
C                   :
C                   ENDDO
C                   :
*...1....+....2....+....3....+....4....+....5....+....6....+....7....+....
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
 *
 * The following example uses a DOU loop containing a DOW loop.
 * The IF statement checks indicator 1. If indicator 1 is ON, the
 * MOVE operation is executed, followed by the LEAVE operation,
 * transferring control from the innermost DOW loop to the Z-ADD
 * instruction.  If indicator 1 is not ON, ITER transfers control
 * to the innermost ENDDO and the condition on the DOW is
 * evaluated again.
C                   :
C     FLDA          DOUEQ     FLDB
C                   :
C     NUM           DOWLT     10
C     *IN01         IFEQ      *ON
C                   MOVE      'UPDATE'      FIELD            20
C                   LEAVE
C                   ELSE
C                   ITER
C                   ENDIF
C                   ENDDO
C                   Z-ADD     20            RSLT              2 0
C                   :
C                   ENDDO
C                   :