We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
In one of my project I am talking with MX909 Driver IC with C51 ucontroller. To initialize MX909 if I write module in Assembly language it's working fine. Once I replaced with C same module it's not working.
The only difference I can make for both assembly and C languages is NOP and _nop_() instruction. Is both instructions will take same number of machine cycles?
Thanks, Suresh Kumar Kavula
fallacy: "a misconception resulting from incorrect reasoning"
If the OP translates assembly code to C, and don't get the expected behaviour, it is very reasonable that the OP has made an incorrect assumption or similar. Nothing rude about that!
If the OP has given too little information, it is common practice to mention the most common causes. The use of for loops in time-sensitive code is one of the most common problems - misconceptions - when writing embedded software.
The problem with for loops is not just that they may be implemented in many different ways depending on availability of registers, range of the loop variable, incrementing/decrementing/infinite loops etc. The compiler may also make decisions about what code to move out from the loop, if it can't seen any side effect.
The OP also thanks Erik for his - very valid - suggestions.
People starting to complain to the left and right really do have too much time on their hands. It seems people are spending a significant amount of time trying to figure out ways to intentionally misunderstand. Is that the action of grownups or bored youths?