

Task

Demonstrate a   for-loop   where the step-value is greater than one.



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


 
/* ARM assembly AARCH64 Raspberry PI 3B */
/*  program loopstep64.s   */
 
/*******************************************/
/* Constantes file                         */
/*******************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeConstantesARM64.inc"
 
.equ MAXI,   20
/*********************************/
/* Initialized data              */
/*********************************/
.data
szMessResult:  .asciz "Counter =  @ \n"      // message result
 
/*********************************/
/* UnInitialized data            */
/*********************************/
.bss 
sZoneConv:             .skip 24
/*********************************/
/*  code section                 */
/*********************************/
.text
.global main 
main:                           // entry of program 
    mov x4,0                    // init counter
1:                              // begin loop 
    mov x0,x4
    ldr x1,qAdrsZoneConv        // display value
    bl conversion10             // call function with 2 parameter (x0,x1)
    ldr x0,qAdrszMessResult
    ldr x1,qAdrsZoneConv   
    bl strInsertAtCharInc       // insert result at first @ character
    bl affichageMess            // display message
    add x4,x4,2                 // increment counter by 2
    cmp x4,MAXI                 //
    ble 1b                      // loop
 
100:                            // standard end of the program 
    mov x0,0                    // return code
    mov x8,EXIT                 // request to exit program
    svc 0                       // perform the system call
 
qAdrsZoneConv:            .quad sZoneConv
qAdrszMessResult:         .quad szMessResult
/********************************************************/
/*        File Include fonctions                        */
/********************************************************/
/* for this file see task include a file in language AArch64 assembly */
.include "../includeARM64.inc"
 