Keil Logo

C51: Using NOP in C

Information in this article applies to:

  • C51 All Versions


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


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;



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

Last Reviewed: Tuesday, October 27, 2020

Did this article provide the answer you needed?
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.