On Fri, 31 Mar 2023 01:42:20 +0200, Bernd Oppolzer wrote:
>
>Am 31.03.2023 um 01:23 schrieb Paul Gilmartin:
>>>
>> Hmmm. In
>> <https://www.ibm.com/docs/en/zos/2.5.0?topic=programs-calling-c-code-from-assembler-c-example>
>> ...
>This @PRINTF4 cannot be the same as normal PRINTF;
>it must be a glue function or similar to allow an ASSEMBLER function to
>call normal PRINTF.
>
That comes fron:
z/OS 2.5 XL C/C++ Programming Guide (SC14-7315-50)
Figure 52. Calling an intermediate XL C/C++ function
from Assembler using OS linkage
Yes, "intermediate" isa key word; akin to your "glue".
And printf is a particular challenge because it supports
a variable-length list of parameters of mixed types.
A moore general approach might be an assembler macro
that takes a list of (type,value) pairs ahd builds the
static reg1 PL.
A typical call might look like:
LABEL CCALL X(fprintf),(FILE*,stdout),(char*,FMTSTR),(long,INTVAL),..,
(punctuation is left as an exercise for the student,
who knows HLASM and C better than I)
Perhaps such a macro already exists; perhaps on CBTTAPE.ORG.
--
gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN