Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

bradjc
Copy link
Contributor

@bradjc bradjc commented Oct 26, 2022

Pull Request Overview

After reading through the cortex-m assembly 100 times, I think we should capture what is actually going on so future readers can get up to speed quicker. This also tries to make the format consistent since rustfmt doesn't help here.

I also changed assembly like:

movw LR, #0xFFF9
movt LR, #0xFFFF

to:

ldr lr, =0xFFFFFFF9

which asks the assembler to figure out the best way to load that 32 bit immediate into the register. Since we are mostly doing this with numbers which are mostly 0xf-s, the assembler uses the mvn instruction:

mvn lr, #6

which loads the bitwise not of the immediate into the register.

Note! The psuedoinstruction has to use the = symbol, as the # does something very different.

ldr lr, =0xFFFFFFF9  // works as expected
ldr lr, #0xFFFFFFF9  // does something very different and wrong

Testing Strategy

Running on hail.

TODO or Help Wanted

n/a

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

After reading through the cortex-m assembly 100 times, I think we should
capture what is actually going on so future readers can get up to speed
quicker. This also tries to make the format consistent since rustfmt
doesn't help here.
@bradjc
Copy link
Contributor Author

bradjc commented Nov 21, 2022

Anyone else ok with this?

@bradjc
Copy link
Contributor Author

bradjc commented Apr 18, 2023

Can we merge this?

@hudson-ayers
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 18, 2023

@bors bors bot merged commit f9ff44c into master Apr 18, 2023
@bors bors bot deleted the cortex-m-asm-comments branch April 18, 2023 21:36
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

Successfully merging this pull request may close these issues.

2 participants