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

Assembly: Alternative Approach #208

Open
brubrz opened this issue Feb 7, 2023 · 0 comments
Open

Assembly: Alternative Approach #208

brubrz opened this issue Feb 7, 2023 · 0 comments

Comments

@brubrz
Copy link

brubrz commented Feb 7, 2023

    mov  rax, -100  ; replace 100 with the array size
loop:
    add  edx, DWORD PTR [rax + 100 + rcx]
    add  rax, 4
    jnz  loop       ; checks if the result is zero

https://github.com/algorithmica-org/algorithmica/blob/master/content/english/hpc/architecture/loops.md

I don't understand why the +rcx is needed? Isn't it enough to add back the 100?

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