title: Unable to declare Procedure in 8051 Assembly programming language
body: <p>I want to work with 8051 Procedure. What i want to do is to declare a procedure for delay and use it for led blinking. I'm using <strong>Keil uVision3</strong> to write my code. I have googled a lot but did not find any help. Below is the the sample code of my program.</p>
  
  <pre><code>ORG 00h
  
  MOV P0, #00h
  MOV P1, #00h
  MOV P2, #00h
  MOV P3, #00h
  
  CALL DELAY PROC     ;calling delay procedure to produce some delay.
  
  
  DELAY PROC           ;procedure implementation starts here for generating some delay
  
      MOV R0, #255
  
      NOW:
      DJNE R0, 0 , HERE
  
      MOV R1, #255
  
      HERE: 
      DJNE R1, 0, NOW
  
      RET
      ENDP
  
  
  END
  </code></pre>
  
  <p>This code gives some syntax errors. What is the correct syntax to declare a procedure and how to use it. Please guide me, what is wrong with my code and please make me correct. I would be thankful to you.</p>