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

using register bank in C167

I found how to use one specific register bank for a function (interupt)by specifying using My_Bank and so, be faster (less PUSH and POP)but I would like to know if I can specify a variable to be located in one register bank (for speed), and, if yes, how to do it?

Parents
  • regarding to genarated code by C compiler with speed optimisation, I think I could win just 1 or 2us...

    I don't know anything about your application, so I cannot tell if 2 microseconds is substantial or not. But I would avoid using non-standard C or assembler trickery unless absolutely necessary.
    As Donald Knuth put it, "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." Code readability is important, and you will lose some of it when optimizing.
    The above applies to production code. In contrast, if you are trying to push the limits of processor/compiler for educational purposes, you can probably afford some amount of messy code...

    Regards,
    - mike

Reply
  • regarding to genarated code by C compiler with speed optimisation, I think I could win just 1 or 2us...

    I don't know anything about your application, so I cannot tell if 2 microseconds is substantial or not. But I would avoid using non-standard C or assembler trickery unless absolutely necessary.
    As Donald Knuth put it, "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." Code readability is important, and you will lose some of it when optimizing.
    The above applies to production code. In contrast, if you are trying to push the limits of processor/compiler for educational purposes, you can probably afford some amount of messy code...

    Regards,
    - mike

Children