bdfs1m0w | Structured Programming Macros |
Use this macro group to process specific code based on one of the following:
The #DO macro group includes the following macros:
See #DO Macro Group Processing for diagrams that show the processing flow of the #DO macro group.
Format
|
Notes:
|
The form of #DO FROM using a BC or BCR loop is the basic form. The form of #DO FROM using a BXH or BXLE loop allows values to be saved during the processing of the loop. The type of loop generated depends on the following:
The value of initval can be:
You can enter an address in one of the following ways:
In both cases, the initial value is the address of label label.
You can enter labels in one of the following ways:
The valid values for byval are the same as for initval, with the exception of single-byte fields or single-byte literals.
The valid values for toval are the same as for initval, with the exception of single-byte fields or single-byte literals.
For clarity, it is recommended that you always code a matching #OREL macro for each #EXIF macro. However, if you do not specify the #OREL macro, it will be automatically generated between a #EXIF macro and any of the following:
Entry Requirements
None.
Return Conditions
Control is returned to the next sequential instruction after the #EDO macro statement unless another assembler instruction or macro passes control outside the #DO structure.
Programming Considerations
#@LBn EQU *
Where:
You can use the PREFIX parameter to change the standard link-label prefix.
#DO WHILE=(OC,FLD,FLD,NZ) : * Code to be processed repeatedly only if FLD is not zero. * This code will be done more than once only as long as * R2 does not equal R3 because of the following #DOEX. : #DOEX (CR,R2,EQ,R3) : * Exit the loop if R2 = R3. * Code to be processed repeatedly if FLD is not zero and * R2 does not equal R3. : #EDO
#DO UNTIL=(CLC,FLDA,GE,FLDB) : * Code to be processed at least once, and more than * once as long as FLDA remains less than FLDB. : #EDO
#DO UNTIL=(CR,R2,GE,R3) : * Code to process until R2 >= R3. * This is done on each iteration, and at least once. : #EXIF TM,0(R2),X'FF',O : * Code to process if the bits are set to X'FF'. * Exit processing is performed (once only) the first * time the TM results in ones. * Processing continues at the #EDO macro. : #OREL : * Code to process if the bits are not set. * Processing to be done on each iteration, as long as no exits * are taken. : #EXIF CH,R4,NL,MAX : * Code for another #EXIF process: Maximum reached. * Exit processing to be performed (once only) the first * time R4 >= MAX. * Processing continues at the #EDO macro. : *** #OREL generated automatically here * #DOEX CLC,4(4,R2),EQ,=F'0' : * If #DOEX indicates no more items, go to #ELOP macro for * loop-end processing. * * Code to be processed on each iteration, as long as no exits * are taken. : #ELOP : * End of loop, start loop-end processing. * Loop-end processing is done once only as a result of * iteration termination by the UNTIL condition (R2 >= R3), * or because the #DOEX exit was taken. * * If one of the #EXIF exits was taken, this code is never * processed. : #EDO
#DO TIMES=(R2) : * Code to process the number of times specified by the * value in R2. : #EDO
#DO TIMES=(R2,100,R3) : * Code to process 100 times. : #EDO
#DO TIMES=(R15,X/EBW000) : * Code to process the number of times specified by the value in * the byte at EBW000. : #EDO
#DO FROM=(R3,0),BY=4,TO=(EBW000) : * Code to process the specified number of times. : #EDO
#DO FROM=(R3,EBW000),BY=L'FL,TO=(H/EBW020,EXCLUSIVE) : * Code to process the specified number of times. : #EDO
#DO FROM=(R2,10),BY=(R4,10),TO=(R5,100) : * Code to process 10 times. : #EDO
#DO FROM=(R2,100),BY=(R4,-4),TO=(R5,A/VAL) : * Code to process the specified number of times. : #EDO
#DO FROM=(R3,1000,EBW040),BY=(R14,20,EBW044),TO=(R15,EBW048) : * Code to process the specified number of times. : #EDO
#DO BXLE,FROM=(R2),BY=(R4),TO=(R5) : * Code to process using a BXLE loop based on the contents of * R2, R4, and R5. : #EDO
#DO WHILE=(LTR,R0,R0,Z),UNTIL=(CR,R2,LE,R3) * * The WHILE condition is tested here. : * loop processing : * The UNTIL condition is tested here. * #EDO
#DO WHILE=(CR,R2,EQ,R3),TIMES=(R14,10) * * The WHILE condition is tested here. : * loop processing : * The TIMES BCT is generated here. * #EDO
#DO WHILE=(R3,NZ),UNTIL=(R2,EQ,R4),TIMES=(R5,#ITEMS) * * The WHILE condition is tested here. : * loop processing : * The UNTIL condition is tested here. * * The TIMES BCT is generated here. * #EDO
Related Macros