2021-03-30 11:36 AM
I'm working with the STM32F446 microcontroller and sometimes I want to assign a peripheral register values from different variables in as few clock cycles as possible. I read in PM0214 https://www.st.com/resource/en/programming_manual/dm00046982-stm32-cortex-m4-mcus-and-mpus-programming-manual-stmicroelectronics.pdf page 18 that the core has some General Purpose Registers R0 ... R12. Am I allowed to use those for my own purposes and if so, what's the syntax to use them?
2021-03-30 01:13 PM
In assembler you can manage them anyway you want.
The compiler follows the ABI specification, and allocates them to local and optimized variables. The register directive is generally ignored at this point.
Perhaps get a book on ARM Assembler / Architecture
Look at the code generated by the compiler.