I know a bit about assembly programming in Microchip PIC micro controllers, but I am not an expert.
Can somebody explain me out of the following 3 statements which is most efficient (i.e. less time consuming) in assembly.
x++
x = x + 1
x += 1
I am quite familiar with both C# and Java and I know for sure that there is no difference in efficiency in above 3 statements when we consider a high level programming language. But is there a difference in efficiency when we consider assembly?
Thanks
Those aren’t assembly statements, you’re working at the wrong level of abstraction.
Figuring out which of those C-like statements is faster would require compiling them into assembly then examining that.
Any non-braindead compiler will give you exactly the same code for all three cases.
If you have a braindead compiler then, yes, there’ll almost certainly be a difference between things like:
and: