This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Access to register

Hi all,
i need a help to move my first pass into this world of programming. I use a Cortex-M0 and my question is: how can I access to register R0-R12.. in language C? it's possible?
I would save a variable into one register.
Thanks bye.

Parents
  • So why didn't you start by telling what problem you wanted to solve, instead of directly deciding on a solution and then banging your head when you got stuck?

    Why not adjust the RAM memory size in the project settings and make the RAM 4 byte smaller - then store your value in these 4 bytes? The RAM only gets zeroed because the startup code is instructed to initialize the RAM - but RAM it hasn't been instructed to zero will not be zeroed. There are also options to specify that a block of RAM should not be zero-initialized.

Reply
  • So why didn't you start by telling what problem you wanted to solve, instead of directly deciding on a solution and then banging your head when you got stuck?

    Why not adjust the RAM memory size in the project settings and make the RAM 4 byte smaller - then store your value in these 4 bytes? The RAM only gets zeroed because the startup code is instructed to initialize the RAM - but RAM it hasn't been instructed to zero will not be zeroed. There are also options to specify that a block of RAM should not be zero-initialized.

Children