title: Assembly procedure calling from C (Intel 8086)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/14278373/intel-8086-assembly-procedure-calling-from-c">Intel 8086 Assembly procedure calling from C</a>  </p>
  </blockquote>
  
  
  
  <p>I need to prepare a procedure in Assembly for Intel 8086 able to be called from a C (pass a string and return an integer value (16bit)). My assembly procedure works perfectly fine "stand-alone". I need help with connecting them together.</p>
  
  <p>Program is supposed to run on Intel 8086. I need to use MASM or emu8086 as assembler/simulator. Kindly recommend a C compiler and also a way to make the simple C program that is able to call the assembly procedure and get the returned value.</p>
  
  <p><em>How can I connect the ASM file and the C file? (How will the compiler know where is the definition/code for this procedure?)</em></p>
  
  <p><em>How can I receive the string sent from C in Assembly language, also how to return the integer to C from Assembly?</em></p>