[comp.lang.c] Linking Objects

hb@vpnet.chi.il.us (hank barta) (05/27/90)

(nice header parasitized from previous response!)

In article <25776@eerie.acsu.Buffalo.EDU> v065nmma@ubvmsd.cc.buffalo.edu
writes:
 >
 >    This could be tough; you know that JPI uses its own calling conventions,
 >right?  The default is to pass as many parameters as possible in registers.
 >You would have to make sure that the C routine calling the JPI object code
 >knew where to put its parameters.  If you bought the JPI tech kit, you could
 >recompile the Modula-2 libraries with C calling conventions, which would make
 >things easier.

There are two other options I know of. Some compilers provide #pragmas
that allow you to specify the calling conventions. Watcom C does this.
Or you could write a small 'glue' assembler routine will translate the
calling conventions of one language to that of another, such as pushing
register variables on the stack. Even if the compiler documentation
does not describe the calling conventions, you may be able to fathom
them by examining disassembled code.



White Oak Software Inc.                 Henry Barta
0 South 258 Park                        (708) 510-0578 (voice)
Winfield, IL 60190                      ...!vpnet.chi.il.us!pswin!barta
Predictable systems by design.          hb@vpnet.chi.il.us