โค้ดที่แทรกเพื่อแสดง
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src='http://www.praphas.com/displaycode/scripts/shCore.js' type='text/javascript'></script> 
<script src='http://www.praphas.com/displaycode/scripts/shBrushJScript.js' type='text/javascript'></script> 
<link type="text/css" rel="stylesheet" href="http://www.praphas.com/displaycode/styles/shCoreDefault.css"/>
<script type="text/javascript">SyntaxHighlighter.all();</script>
<body style="background: white; font-family: Helvetica">
<pre class="brush: js;">
#include<REGX52.h>
void delay(int n);
void main(void)
{
  unsigned char value=0;
  while(1)
  {
    P0=value;  
    delay(100);
    value++;  
  }
}
/*  delay function 
*/
void delay(int n)      
{
  int x,y;
  for(x=0;x<n;x++)
  {
    for(y=0;y<500;y++)
    {
    }    
  }
}
</pre>
#include <REGX52.h>
void delay(int n);
void main(void)
{
  unsigned char value=0;
  while(1)
  {
    P0=value;  
    delay(100);
    value++;  
  }
}
/*  delay function 
*/
void delay(int n)      
{
  int x,y;
  for(x=0;x<n;x++)
  {
    for(y=0;y<500;y++)
    {
    }    
  }
}