SourcePoint AMD Help

Table of Contents

do while

Group and conditionally execute emulator commands.

Syntax

do {commands} while(bool-cond)

Where:

commands

specifies one or more emulator commands. The braces are required when you enter multiple commands.

bool-cond

specifies that the loop ends when bool-cond is false. The bool-cond option specifies a number or an expression that must evaluate to true (non-zero) or false (zero).

Discussion

Use the do while control construct to define a loop that is executed at least once. The test for continued execution (evaluation of bool-cond) comes after the command (or group of commands) is executed. Always enclose the loop body {commands} in braces when there is more than one command. The commands are re-executed while the expression evaluates to true. The include command is not executable inside the do while control construct.

Example

The following example shows how to display uppercase alphabetic characters using a do while loop.

Command input:

define int4 a = 41h

define char c

do

{

ย ย ย c = toascii(a)

ย ย ย c

ย ย ย a += 1

}

while (a <= 5Ah)

Result:

'A'
'B'
.
.
.
'Y'
'Z'

Related Topics: