Start with a value at 0. Loop while value mod 6 is not equal to 0.
Each time through the loop, add 1 to the value then print it.
The loop must execute at least once.



Related tasks

   Loop over multiple arrays simultaneously
   Loops/Break
   Loops/Continue
   Loops/Do-while
   Loops/Downward for
   Loops/For
   Loops/For with a specified step
   Loops/Foreach
   Loops/Increment loop index within loop body
   Loops/Infinite
   Loops/N plus one half
   Loops/Nested
   Loops/While
   Loops/with multiple ranges
   Loops/Wrong ranges


Reference

 Do while loop Wikipedia.


*        Do-While
DOWHILE CSECT  ,                  This program's control section 
         BAKR  14,0               Caller's registers to linkage stack 
         LR    12,15              load entry point address into Reg 12 
        USING  DOWHILE,12         tell assembler we use Reg 12 as base 
         XR    9,9                clear Reg 9 - divident value 
         LA    6,6                load divisor value 6 in Reg 6 
         LA    8,WTOLEN           address of WTO area in Reg 8 
LOOP     DS    0H 
         LA    9,1(,9)            add 1 to divident Reg 9 
         ST    9,FW2              store it 
         LM    4,5,FDOUBLE        load into even/odd register pair 
         STH   9,WTOTXT           store divident in text area 
         MVI   WTOTXT,X'F0'       first of two bytes zero 
         OI    WTOTXT+1,X'F0'     make second byte printable 
        WTO    TEXT=(8)           print it (Write To Operator macro) 
         DR    4,6                divide Reg pair 4,5 by Reg 6 
         LTR   5,5                test quotient (remainder in Reg 4) 
         BNZ   RETURN             if one: 6 iterations, exit loop. 
         B     LOOP               if zero: loop again. 
RETURN   PR    ,                  return to caller. 
FDOUBLE  DC    0FD 
         DC    F'0' 
FW2      DC    F'0' 
WTOLEN   DC    H'2'               fixed WTO length of two 
WTOTXT   DC    CL2' ' 
         END   DOWHILE 