Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While Loop Example README.md Possible Mistake #21

Open
iamwestoff opened this issue Feb 22, 2024 · 0 comments
Open

While Loop Example README.md Possible Mistake #21

iamwestoff opened this issue Feb 22, 2024 · 0 comments

Comments

@iamwestoff
Copy link

While Loop example README.md

In this portion of the code:

while (a >= b) {
    // CODE BLOCK
}

Here is the code for the while showing the addition of one new label
and one new unconditional branch:

    // Assume value of a is in x0                                       // 1 
    // Assume value of b is in x1                                       // 2 
                                                                        // 3 
 1: cmp     x0, x1                                                      // 4 
    bgt     2f                                                          // 5 
    // CODE BLOCK                                                       // 6 
    b       1b                                                          // 7 
                                                                        // 8 
2:                                                                      // 9 

The portion while (a >= b) as discovered in class may have imposed in error in the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant