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
  • Thanks you... I will see for IDATA or SDATA...

    regarding to documentation I sow that Whe can specify registers to be use in a function by @register_Mask...

    but, then I must program by asm directives cause it semm whe have no acces to registers R1...R12 by C lines (offset whith CP)...

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

Reply
  • Thanks you... I will see for IDATA or SDATA...

    regarding to documentation I sow that Whe can specify registers to be use in a function by @register_Mask...

    but, then I must program by asm directives cause it semm whe have no acces to registers R1...R12 by C lines (offset whith CP)...

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

Children
  • 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

  • Ok, it's what I think and I say... just for 1 or 2us, it's better to to prioritys the readability of the code... I just looked for a simple way to use Registers like in the 80c196... the way seem to use IDATA like it' said below...