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

NOP Vs _nop_()?

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

Parents
  • wlee Mr. smoked sardine, as usual you put words in my mouth that I would never use.

    No. You suggested the correction to your original assertion, I agreed with it.

    I *never* put words in your mouth, I only quote those that come out of it. I do not indulge in the deliberate misquoting tactic you have demonstrated in so many previous threads.

    My guess is that you suffer from some fallacy that e.g. a for loop always is the same as a djnz loop

    Don't be silly.

Reply
  • wlee Mr. smoked sardine, as usual you put words in my mouth that I would never use.

    No. You suggested the correction to your original assertion, I agreed with it.

    I *never* put words in your mouth, I only quote those that come out of it. I do not indulge in the deliberate misquoting tactic you have demonstrated in so many previous threads.

    My guess is that you suffer from some fallacy that e.g. a for loop always is the same as a djnz loop

    Don't be silly.

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