loop
Prev | Orchestra Opcodes and Operators | Next

## loop

loop — Four looping constructions.

## Description

Construction of looping operations.

## Syntax

    loop_lt   indx, incr, imax, label

    loop_lt   kndx, kncr, kmax, label

    loop_le   indx, incr, imax, label

    loop_le   kndx, kncr, kmax, label

    loop_gt   indx, idecr, imin, label

    loop_gt   kndx, kdecr, kmin, label

    loop_ge   indx, idecr, imin, label

    loop_ge   kndx, kdecr, kmin, label

## Initialization

indx -- i-rate variable to count loop.

incr -- value to increment the loop (loop_lt, loop_le)

idecr -- value to decrement the loop (loop_gt, loop_ge)

imax -- maximum value of loop index (loop_lt, loop_le)

imin -- minimum value of loop index (loop_gt, loop_ge)

## Performance

The actions of loop_lt is equivalent to the code

             indx  =  indx + incr
             if (indx < imax) igoto label

or

             kndx  =  kndx + kncr
             if (kndx < kmax) kgoto label

The actions of loop_le is equivalent to the code

             indx  =  indx + incr
             if (indx <= imax) igoto label

or

             kndx  =  kndx + kncr
             if (kndx <= kmax) kgoto label

The actions of loop_gt is equivalent to the code

             indx  =  indx - idecr
             if (indx > imin) igoto label

or

             kndx  =  kndx - kdecr
             if (kndx > kmin) kgoto label

The actions of loop_ge is equivalent to the code

             indx  =  indx - idecr
             if (indx >= imin) igoto label

or

             kndx  =  kndx - kdecr
             if (kndx >= kmin) kgoto label

## Credits

Istvan Varga.

Prev | Up | Next
logbtwo | Home | loopseg