The usual method is to use a build environment and tools that has an assembler as well as a C/C++ compiler. Compilers (and assemblers) take source files and produce an intermediate object file format. On Microsoft Windows, with Microsoft Tools, these would be .obj files.
A linker is then used to link the .obj files - which were potentially produced by a wide variety of languages - fortran, cobol, c++, c, objective-c, assembly etc, into a single application binary.
Object files are basically a collection of exported symbols, labeling little chunks of bytes, and unresolved symbols, labeling chunks of bytes that need to be patched during linking to point to something in a different object file.
Now, the usual problem - on the platforms Ive experienced which are not close to yours, are, c++ compilers are not made with any kind of cross language binary compatibility in mind. C compilers on the other hand, are. So c++ compilers make highly mangled symbols that incorporate all sorts of information about parameter and return types into the symbol names. This mechanism is what makes operator overloading possible.
Anyway, the crux is,
- You need to build the asm files. If you dont have an assembler, you're outa luck. And it probably needs to come from the same vendor as your c/c++ toolset
- You need to tell your c++ program the names of the external symbols. In a c compatible way. This is what header files are typically used for.
So create a header file to hold function declarations for the pid code and place Something like this in them:
extern "C" void PidMain(void);
Now, #include that header file in your c++ program, and ensure that the object files produced by the assembler are included in your environments link step and you should be golden.
There might be some kind of calling convention involved. Some environments have different standards as to the order things are pushed onto the stack, and/or who is responsible for stack cleanup. Most ms windows toolsets support at least a __pascal and __cdecl calling convention, so the declration would look like
extern "C" void __pascal PidMain(void);
I have no specific knowledge if there are multiple calling conventions in your specific environment. So I don't know how helpful this has been. Good luck I guess.