| 自由形式構文 | (許可されていない - DOU 命令コードを使用) |
| コード | 演算項目 1 | 演算項目 2 | 結果フィールド | 標識 | ||
|---|---|---|---|---|---|---|
| DOUxx | 被比較値 | 被比較値 | ||||
DOUxx 命令コードは、最低 1 回 (おそらくはそれ以上) 実行したい命令のグルー プの前に置かれます。 対応する ENDDO ステートメントは、このグループの終わりを示します。DO グループの詳細と xx の意味については、構造化プログラミング命令を参照してください。
演算項目 1 と演算項目 2 には、リテラル、名前のついた定数、フィールド 名、テーブル名、配列要素、形象定数、またはデータ構造名を入れなければな りません。 演算項目 1 と演算項目 2 は同じデータ・タイプでなければなりませ ん。
このグループは、グループの開始時にこの条件が 真でない場合であっても、常に最低 1 回は処理されます。
DOUxx 命令自体のほかに、 DOUxx グループは、DOUxx および ENDDO ステートメントの条件付け標識に よっても制御されます。 DOUxx ステートメントの条件付け標識は、DOUxx 命令を開始するかどうかを 制御します。 対応する ENDDO ステートメントの条件付け標識では、DO ループを早期に終了 させることができます。
これらの命令が DOUxx 命令にどのような影響を与えるかについて は、LEAVE (Do/For グループからの抜け出し)および ITER (繰り返し)を参照してください。
詳細については、比較命令または 構造化プログラミング命令を参照してください。
*...1....+....2....+....3....+....4....+....5....+....6....+....7...+....
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
*
* The DOUEQ operation runs the operation within the DO group at
* least once.
C
C FLDA DOUEQ FLDB
C
*
* At the ENDDO operation, a test is processed to determine whether
* FLDA is equal to FLDB. If FLDA does not equal FLDB, the
* preceding operations are processed again. This loop continues
* processing until FLDA is equal to FLDB. When FLDA is equal to
* FLDB, the program branches to the operation immediately
* following the ENDDO operation.
C
C SUB 1 FLDA
C ENDDO
C
*
* The combined DOUEQ ANDEQ OREQ operation processes the operation
* within the DO group at least once.
C
C FLDA DOUEQ FLDB
C FLDC ANDEQ FLDD
C FLDE OREQ 100
C
*
* At the ENDDO operation, a test is processed to determine whether
* the specified condition, FLDA equal to FLDB and FLDC equal to
* FLDD, exists. If the condition exists, the program branches to
* the operation immediately following the ENDDO operation. There
* is no need to test the OREQ condition, FLDE equal to 100, if the
* DOUEQ and ANDEQ conditions are met. If the specified condition
* does not exist, the OREQ condition is tested. If the OREQ
* condition is met, the program branches to the operation
* immediately following the ENDDO. Otherwise, the operations
* following the OREQ operation are processed and then the program
* processes the conditional tests starting at the second DOUEQ
* operation. If neither the DOUEQ and ANDEQ condition nor the
* OREQ condition is met, the operations following the OREQ
* operation are processed again.
C
C SUB 1 FLDA
C ADD 1 FLDC
C ADD 5 FLDE
C ENDDO