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

Assign a global variable to a register

Hello,

in my application I use often a global variable. Since this variable is use in lots of functions, I'd like to assign it to a specific register (like DR28). It is possible? If yes, how can I do such a thing?

Thanks

Parents
  • C51 has a "Global Register Optimisation" option - see the REGFILE directive.
    Dunno if C251 has the same; if it does, you could try it.

    Warning: there's a bug in uVision v2.07 which means the 'Global Register Coloring' checkbox won't work if you have any spaces in your Project Name (everything else works; Keil just forgot the quotes on the REGFILE linker option!)

    NEIDE: "Not Entirely Integrated Development Environment" ;-)

Reply
  • C51 has a "Global Register Optimisation" option - see the REGFILE directive.
    Dunno if C251 has the same; if it does, you could try it.

    Warning: there's a bug in uVision v2.07 which means the 'Global Register Coloring' checkbox won't work if you have any spaces in your Project Name (everything else works; Keil just forgot the quotes on the REGFILE linker option!)

    NEIDE: "Not Entirely Integrated Development Environment" ;-)

Children
No data