Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/25/05 06:17
Read: times


 
Msg Score: +2
 +2 Good Answer/Helpful
#102883 - Not true
Responding to: ???'s previous message
Sarang Patki said:
But you can always check back the generated assembly code and decide the load count much closer to the required delay.

So where's the point in that?
If you have to manually inspect the generated assembler in details every time, you would be far better off to just write it in assembler in the first place. Then you you know exactly what you've go, and you know that it won't change on some whim of the compiler...

If we take an example of keil compiler, it generates a fixed code for fixed conditional statements with same optimisation level.

No, it's not as simple as that.
No high-level language ever guarantees that any specific source line(s) will be implemented as any specific machine instructions.
It is quite possible that the same source lines will generate different machine instructions due to differences in the surrounding code - especially at the higher optimisation levels.
And, of course, if you change compiler version, you might change all the rules!

If you change or alter the level then the code is bound to change.

Not just the optimisation level - also other settings like memory model.
Again, just traps for the unwary - better to just avoid them in the first place!

The point is, you can do this in 'C', but it is pointless - you just make extra work for yourself (having to keep checking the generated code).
If you do it in assembler, you know where you are. Period.



List of 17 messages in thread
TopicAuthorDate
passing parameters from c to assembly            01/01/70 00:00      
   RTFM            01/01/70 00:00      
   What Compiler? They are all differerent            01/01/70 00:00      
   Why assembly???            01/01/70 00:00      
      some things can not be done in C            01/01/70 00:00      
         Yes you can...            01/01/70 00:00      
            Not true            01/01/70 00:00      
            eliminated            01/01/70 00:00      
            bull!            01/01/70 00:00      
         delay in C, yes !            01/01/70 00:00      
         More on 'C' delay loops...            01/01/70 00:00      
   sure, when you use a timer            01/01/70 00:00      
   Total Malund!            01/01/70 00:00      
      dear Russell re "bull"            01/01/70 00:00      
         Malund Bull...            01/01/70 00:00      
   Public variable            01/01/70 00:00      
   Examples...            01/01/70 00:00      

Back to Subject List