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
  • "The authoritative masquerade very clearly exposed!"

    Not really.

    All it has shown is that, in one particular case, the for loop just happened to turn out as a simple DJNZ loop.

    In general, you can't assume that.

    eg, in the example shown, the oprimiser has happened to assign the loop counter to R7 - unrelated changes in the source code could change that, which may or may not affect the loop timing!

    One more time: There is absolutely no guarantee whatsoever etc, etc,...

Reply
  • "The authoritative masquerade very clearly exposed!"

    Not really.

    All it has shown is that, in one particular case, the for loop just happened to turn out as a simple DJNZ loop.

    In general, you can't assume that.

    eg, in the example shown, the oprimiser has happened to assign the loop counter to R7 - unrelated changes in the source code could change that, which may or may not affect the loop timing!

    One more time: There is absolutely no guarantee whatsoever etc, etc,...

Children