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

The swp instruction does not function correctly unless the address is a multiple of 4. #20

Open
fkuzume opened this issue May 5, 2024 · 0 comments

Comments

@fkuzume
Copy link

fkuzume commented May 5, 2024

    mov     r0, #32
    mov     r1, #64
    str     r1, [r11]
    add     r2, r11, #1
    swp     r3, r0, [r2]

When the value of r2 is not a multiple of 4, the swp instruction does not function correctly.

According to the ARM Architecture Reference Manual:

temp = Memory[address,4] Rotate_Right (8 * address[1:0])
Memory[address,4] = Rm
Rd = temp

This is how it is described.

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