title: recursive proc with local variables in assembly
body: <p>I wanna make recursive proc with local variables in assembly ( intel 8086 ). so I do it like following code:</p>
  
  <pre><code>MOEIN PROC NEAR
          IPTEMP DW ?
          NUM DW ?
          POP IPTEMP
          POP NUM
          DEC NUM
          CMP NUM,0H
          JZ EXIT
  
          PUSH NUM
  
          CALL MOEIN
  
          EXIT:
          PUSH IPTEMP
          RET
          MOEIN ENDP</code></pre>
  
  <p>it should do following code:</p>
  
  <pre><code>void moein(int x)
  {
  x--;
  if (x != 0)
     moein(x);
  }</code></pre>
  
  <p>but it can't do it.it will lost the back way.
  how could I do it by assembly like what I write in C?</p>