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

How can __global_reg() declaration work?

In C program,I had wroten a declaration like this:
__global_reg(4) int Reg_R7;
I wish r7 register be reserved,but it dose not work: r7 register still be used by compiler in orther work.
How can I do?
Thank a lot!

Parents
  • There is only one .c file in my project. The program after the delaration be compiled that r7 register involved.
    I had read the web page you noticed me carefully, but I have no idear.
    Would you please tell me what shoud I do.
    Thank you!

Reply
  • There is only one .c file in my project. The program after the delaration be compiled that r7 register involved.
    I had read the web page you noticed me carefully, but I have no idear.
    Would you please tell me what shoud I do.
    Thank you!

Children
  • "Would you please tell me what shoud I do."

    What you should have started with, was to give a very good and convincing reason why you want to steal one register from the compiler and make it into a global variable - is your program so special that this actually gains you any advantage?