Technical Support

C51: USING NOP IN C


Information in this article applies to:

  • C51 All Versions

QUESTION

What is the syntax for using an NOP instruction in C?

ANSWER

The C51 Compiler comes with an intrinsic library function you may call to invoke the NOP instruction. The NOP instruction is inserted inline. For example:

#include <intrins.h>

void tst_nop (void)  {

   P1 = 0xFF;

   _nop_ ();    // delay
   _nop_ ();
   _nop_ ();

   P1 = 0x00;

}

MORE INFORMATION

  • Refer to _nop_ in the Cx51 User's Guide.
  • Refer to NOP in the 8051 Instruction Set Manual.

Last Reviewed: Thursday, September 22, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure