ACTR instruction

The ACTR instruction sets a conditional assembly branch counter either within a macro definition or in open code. The ACTR instruction can appear anywhere in open code or within a macro definition.

Each time the assembler processes a successful AIF or AGO branching instruction in a macro definition or in open code, the branch counter for that part of the program is decremented by one. When the number of conditional assembly branches reaches the value assigned to the branch counter by the ACTR instruction, the assembler exits from the macro definition or stops processing statements in open code.

By using the ACTR instruction, you avoid excessive looping during conditional assembly processing.

Read syntax diagramSkip visual syntax diagram>>-+-----------------+--ACTR--arithmetic_expression------------><
   '-sequence_symbol-'                               
 
sequence_symbol
is a sequence symbol.
arithmetic_expression
is an arithmetic expression used to set or reset a conditional assembly branch counter.

A conditional assembly branch counter has a local scope; its value is decremented by AGO and successful AIF instructions, and reassigned only by ACTR instructions that appear within the same scope. Thus, the nesting of macros has no effect on the setting of branch counters in other scopes. The assembler assigns a branch counter for open code and for each macro definition. In the absence of an ACTR instruction, a default value of 4096 is assigned.

Branch counter operations

Within the scope of a branch counter, the following occurs:

  1. Each time an AGO or AIF branch is executed, the assembler checks the branch counter for zero or a negative value.
  2. If the count is not zero or negative, it is decremented by one.
  3. If the count is zero or negative, the assembler takes one of two actions:
    1. If it is processing instructions in open code, the assembler processes the remainder of the instructions in the source module as comments. Errors discovered in these instructions during previous passes are flagged.
    2. If it is processing instructions inside a macro definition, the assembler terminates the expansion of that macro definition and processes the next sequential instruction after the calling macro instruction. If the macro definition is called by an outer macro instruction, the assembler processes the next sequential prototype instruction after the call; that is, it continues processing at the next outer level of nested macros.

The assembler halves the ACTR counter value when it encounters serious syntax errors in conditional assembly instructions.


[ Top of Page | Previous Page | Next Page | Contents | Index ]