Hello.
I have a friend who was a COBOL programmer professionally
for many years but is now long retired.
He has no interest in learning any other languages,
but he enjoys dabbling with Micro Focus COBOL/2 2.4.17
to develop 16 bit DOS 6.22 programs for his own use.
He needs some help with math algorithms.
I have a strong background in math and physics,
but zero experience with COBOL,
and I would like to write some 16-bit DOS C functions
that he could call from his COBOL programs.
I'm having difficulty finding information in the form
of simple working examples on how to do this.
Figuring out the math
and writing the C functions
is not the problem.
I can churn those out effortlessly.
What I haven't been able to figure out yet,
and would like some help with,
is how to call the C code from MF COBOL/2
and have the C code return the answer(s)
to the COBOL program.
I have figured out how to use
the MF COBOL/2 X"91" function 35
to call (and pass parameters to)
a C executable (EXE),
and when the called C code is done,
it does return to the MF COBOL/2 program,
but I haven't been able to figure out
how to pass information from the C code
back to the calling COBOL program.
The only way I've found so far that works
is to have the C code write the information
to a disk file, and have the COBOL program
read that disk file.
But that's WAY too kludgey for my tastes.
Is there some way to use the stack,
or some static memory area,
or even the DOS 16-bit long
Inter_Application_Communation area (IACA)
at fixed memory address 40H:F0H ?
What I need is simple working COBOL
examples of how to receive infomation
back from the called C code.
Thanks.
I have a friend who was a COBOL programmer professionally
for many years but is now long retired.
He has no interest in learning any other languages,
but he enjoys dabbling with Micro Focus COBOL/2 2.4.17
to develop 16 bit DOS 6.22 programs for his own use.
He needs some help with math algorithms.
I have a strong background in math and physics,
but zero experience with COBOL,
and I would like to write some 16-bit DOS C functions
that he could call from his COBOL programs.
I'm having difficulty finding information in the form
of simple working examples on how to do this.
Figuring out the math
and writing the C functions
is not the problem.
I can churn those out effortlessly.
What I haven't been able to figure out yet,
and would like some help with,
is how to call the C code from MF COBOL/2
and have the C code return the answer(s)
to the COBOL program.
I have figured out how to use
the MF COBOL/2 X"91" function 35
to call (and pass parameters to)
a C executable (EXE),
and when the called C code is done,
it does return to the MF COBOL/2 program,
but I haven't been able to figure out
how to pass information from the C code
back to the calling COBOL program.
The only way I've found so far that works
is to have the C code write the information
to a disk file, and have the COBOL program
read that disk file.
But that's WAY too kludgey for my tastes.
Is there some way to use the stack,
or some static memory area,
or even the DOS 16-bit long
Inter_Application_Communation area (IACA)
at fixed memory address 40H:F0H ?
What I need is simple working COBOL
examples of how to receive infomation
back from the called C code.
Thanks.