.for

In this article

The .for token behaves like the for keyword in C, except that multiple increment commands must be separated by semicolons, not by commas.

.for (InitialCommand ; Condition ; IncrementCommands) { Commands }

Syntax Elements

InitialCommandSpecifies a command that will be executed before the loop begins. Only a single initial command is permitted.

ConditionSpecifies a condition. If this evaluates to zero, it is treated as false; otherwise it is true. Enclosing Condition in parentheses is optional. Condition must be an expression, not a debugger command. It will be evaluated by the default expression evaluator (MASM or C++). For details, see Numerical Expression Syntax.

IncrementCommandsSpecifies one or more commands that will be executed at the conclusion of each loop. If you wish to use multiple increment commands, separate them by semicolons but do not enclose them in braces.

CommandsSpecifies one or more commands that will be executed repeatedly as long as the condition is true. This block of commands needs to be enclosed in braces, even if it consists of a single command. Multiple commands should be separated by semicolons, but the final command before the closing brace does not need to be followed by a semicolon.

The feedback system for this content will be changing soon. Old comments will not be carried over. If content within a comment thread is important to you, please save a copy. For more information on the upcoming change, we invite you to read our blog post.