-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3306: arch: cortex-m: format and comment assembly r=hudson-ayers a=bradjc ### 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: ```asm movw LR, #0xFFF9 movt LR, #0xFFFF ``` to: ```asm 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: ```asm 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. ```asm 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 - [x] Updated the relevant files in `/docs`, or no updates are required. ### Formatting - [x] Ran `make prepush`. Co-authored-by: Brad Campbell <bradjc5@gmail.com>
- Loading branch information
Showing
1 changed file
with
114 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters