Friday, September 16, 2016

While Loop using Do Loop

The if do loop:
if (condition) do {
    //do stuff
} while (condition);
is identical to the while loop:
while (condition)  {
    //do stuff
}
The if do loop is similar to assembly, and the while loop is the high level language version. Both exists in macro assembly.
Note that the body of the loops, and both the condition of the if statement and the while statement of the if do loop must be identical for the loops, if do and while, to be the same.

No comments: