.rept


Tells the assembler to repeatedly expand a series of statements described between this directive and the .endm directive the number of times equivalent to the value of the expression specified in the operand field.

[Syntax]

Symbol field

Mnemonic field

Operand field

Comment field

[label:]
.rept
   :
absolute-expression
[; comment]

[Function]

-

The .rept directive tells the assembler to repeatedly expand a series of statements described between this directive and the .endm directive (called the REPT-ENDM block) the number of times equivalent to the value of the expression specified in the operand field.

[Use]

-

Use the .rept and .endm directives to describe a series of statements repeatedly in a source program.

[Description]

-

An error occurs if the .rept directive is not paired with the .endm directive.

-

If the .exitm directive appears in the REPT-ENDM block, subsequent expansion of the REPT-ENDM block is terminated at that location.

-

Assembly control instructions may be described in the REPT-ENDM block.

-

If a macro definition is written in the REPT-ENDM block, an error will be output.

-

The value is evaluated as a 32-bit signed integer.

-

If the result of evaluating the expression is negative, the assembler outputs the message then stops assembling.

[Example]

.cseg   text
        ; REPT-ENDM block
.rept   3               ; (1)
        nop
        ; Source text
.endm                   ; (2)

(1)

This .rept directive tells the assembler to expand the REPT-ENDM block three consecutive times.

(2)

This directive indicates the end of the REPT-ENDM block.