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
  • Erik,

    Thanks for your quick response. By using keil C I am trying to generate 2.4uSeconds delay by writing 4 _nop_() instructions. For this I am using I am using AT89C5131, X1 clock Mode with 20 MHZ.

    Same C routine if I replace 4 NOP instructions by using #pragma ASM working fine.

    I don't know what the reason is.

    Thanks,
    Suresh Kumar Kavula

Reply
  • Erik,

    Thanks for your quick response. By using keil C I am trying to generate 2.4uSeconds delay by writing 4 _nop_() instructions. For this I am using I am using AT89C5131, X1 clock Mode with 20 MHZ.

    Same C routine if I replace 4 NOP instructions by using #pragma ASM working fine.

    I don't know what the reason is.

    Thanks,
    Suresh Kumar Kavula

Children