Keil Logo

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
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.