On Thu, 30 Mar 2023 23:39:30 +0200, Bernd Oppolzer wrote:
>
>"call by value" in my understanding means, that values are passed, not
>addressed.
>With the mainframe (or z/OS and CMS) linkage convention, this means,
>that values
>and not addresses are in the reg1 parameter list.
> 
What happens if there are more value parameters than the total capacity of 
registers?
(But do I misunderstand?  Is the "reg1 parameter list" not actual registers but 
the
storage addressed by GR1 in the CALL macrlo?  If so, it's no practical limit.)


>see above. Because the values entered into the reg1 list "by value" can
>be negative integers
>(or other types, which need more that 4 bytes), the VL convention cannot
>be used by C callers
>
Hmmm.  In 
<https://www.ibm.com/docs/en/zos/2.5.0?topic=programs-calling-c-code-from-assembler-c-example>
I see:
         EDCPRLG
         LA    1,ADDR_BLK              parameter address block in r1
         L     15,=V(@PRINTF4)         address of routine
         BALR  14,15                   call @PRINTF4
         EDCEPIL
ADDR_BLK DC   A(FMTSTR)                parameter address block with..
         DC   A(X'80000000'+INTVAL)    ..high bit on the last address
*   ...
INTVAL   DC   F'222'            The integer value displayed
*
Isn't the "X'80000000'" setting the VL bit?
(I note that's a CD not an EQU.  But the reg1 PL contains an address not a 
value.)

Again, either the caller or the called routine could be able
to convert addresses to values.

-- 
gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to