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

incrument

hey dudes.
i'm new to this embedded stuff. it looks great. i gotta get a canbus and iic stuff talking. but i have a question.
what is the best way to incrument a variable. i mean what is the fastest most efficiant way to add 1 to couunter. is it ++couunter or couunter++ or couunter+=1 or couunter=couunter+1 or couunter+=ONE. you get my griff.
answers please.

Parents
  • "the easy way to see what is fastest' id to code all varieties and look at the generagted assembled"
    Except that this does often not work.

    With globally optimizing compilers, a single line of source code may produce different sequences of machine instructions depending on a huge number of other factors - register pressure, location of variables, when variable was used last and when it will be used next, where jumps or conditionals are, ...

    Tiny code changes at one point can result in significant changes to the produced code at other locations.

Reply
  • "the easy way to see what is fastest' id to code all varieties and look at the generagted assembled"
    Except that this does often not work.

    With globally optimizing compilers, a single line of source code may produce different sequences of machine instructions depending on a huge number of other factors - register pressure, location of variables, when variable was used last and when it will be used next, where jumps or conditionals are, ...

    Tiny code changes at one point can result in significant changes to the produced code at other locations.

Children
No data