How to resolve the algorithm Loops/Continue step by step in the 360 Assembly programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Loops/Continue step by step in the 360 Assembly programming language

Table of Contents

Problem Statement

Show the following output using one loop.

Try to achieve the result by forcing the next iteration within the loop upon a specific condition, if your language allows it.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Loops/Continue step by step in the 360 Assembly programming language

Source code in the 360 programming language

*        Loops/Continue            12/08/2015
LOOPCONT CSECT
         USING  LOOPCONT,R12
         LR     R12,R15
BEGIN    LA     R8,0
         SR     R5,R5
         LA     R6,1
         LA     R7,10
LOOPI    BXH    R5,R6,ELOOPI       for i=1 to 10
         LA     R3,MVC(R8)
         XDECO  R5,XDEC
         MVC    0(4,R3),XDEC+8
         LA     R8,4(R8)
         LR     R10,R5
         LA     R1,5
         SRDA   R10,32
         DR     R10,R1
         LTR    R10,R10
         BNZ    COMMA
         XPRNT  MVC,80
         LA     R8,0
         B      NEXTI
COMMA    LA     R3,MVC(R8)
         MVC    0(2,R3),=C', '
         LA     R8,2(R8)
NEXTI    B      LOOPI              next i
ELOOPI   XR     R15,R15
         BR     R14
MVC      DC     CL80' '
XDEC     DS     CL16
         YREGS  
         END    LOOPCONT

  

You may also check:How to resolve the algorithm Sorting algorithms/Bubble sort step by step in the Cowgol programming language
You may also check:How to resolve the algorithm User input/Text step by step in the Phixmonti programming language
You may also check:How to resolve the algorithm Towers of Hanoi step by step in the Io programming language
You may also check:How to resolve the algorithm Tonelli-Shanks algorithm step by step in the EchoLisp programming language
You may also check:How to resolve the algorithm Constrained random points on a circle step by step in the Icon and Unicon programming language