0

Possible Duplicate:
Intel 8086 Assembly procedure calling from C

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.

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.

How can I connect the ASM file and the C file? (How will the compiler know where is the definition/code for this procedure?)

How can I receive the string sent from C in Assembly language, also how to return the integer to C from Assembly?

Community
  • 1
  • 1
  • Here's the [HOWTO for GCC](http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html) – Xophmeister Jan 11 '13 at 13:20
  • 1
    To get a 16-bit C compiler you'll have to break into a museum. Try the Borland Museum, door is always open. – Hans Passant Jan 11 '13 at 13:52
  • gcc is a fine compiler, but it's mostly for 32- (or 64-) bit code. It is possible to beat it into producing 16-bit code, but it's a PITA. I would suggest asking your instructor to recommend a suitable compiler. – Frank Kotler Jan 11 '13 at 14:02

0 Answers0