So here is my attempt at specifying just a register

          LHI   2,3
          CALL  @@GETCB,((2)),MF=(E,CALL1)
+         DS    0H                                                       01-CALL
+         LA    1,CALL1                           LOAD PARAMETER REG 1   
03-IHBINNRR
+         ST    (2),0(0,1)                        STORE INTO PARAM. LIST 
02-IHBOPLTX
+         CNOP  0,4                                                      01-CALL
+         BRAS  15,*+8                            BRANCH AROUND VCON     01-CALL
+         DC    V(@@GETCB)                        ENTRY POINT ADDRESS    01-CALL
+         L     15,0(15,0)                        LOAD 15 WITH ENTRY ADR 01-CALL
+         BALR  14,15                             BRANCH TO ENTRY POINT  01-CALL

If I am not mistaken, this is still performing call by reference, not call by 
value, because it's storing the address of an address that holds the value of 3.

What I need is it to store the address of a field holding a value of 3.  One 
less level of indirection.  And that's what we have here.  CHKCICS contains the 
value of 3 and address 1 is loaded with its address.

          CALL  @@GETCB,MF=(E,CHKCICS3) ...WITH VALUE FULLWORD 3
+         DS    0H                                                       01-CALL
+         LA    1,CHKCICS3                        LOAD PARAMETER REG 1   
03-IHBINNRR
+         CNOP  0,4                                                      01-CALL
+         BRAS  15,*+8                            BRANCH AROUND VCON     01-CALL
+         DC    V(@@GETCB)                        ENTRY POINT ADDRESS    01-CALL
+         L     15,0(15,0)                        LOAD 15 WITH ENTRY ADR 01-CALL
+         BALR  14,15                             BRANCH TO ENTRY POINT  01-CALL

NOw if we just load R1 directly with the address holding the value of 3, then 
we need to do a call with no parameters passed, right?  I tried the following:

          LA    1,=F'3'
          CALL  @@GETCB,MF=(E,CALL1) ...WITH VALUE FULLWORD 3
+         DS    0H                                                       01-CALL
+         LA    1,CALL1                           LOAD PARAMETER REG 1   
03-IHBINNRR
+         CNOP  0,4                                                      01-CALL
+         BRAS  15,*+8                            BRANCH AROUND VCON     01-CALL
+         DC    V(@@GETCB)                        ENTRY POINT ADDRESS    01-CALL
+         L     15,0(15,0)                        LOAD 15 WITH ENTRY ADR 01-CALL
+         BALR  14,15                             BRANCH TO ENTRY POINT  01-CALL

I don't think that will work because it clobbers R1.

I just now realized I don't want to use MF=E at all and it looks like that 
could work.  In fact, it appears to generate the same code as the second 
example (the one that works for sure), except without the loading of R1 at all, 
which of course I have done explicitly as you recommend.  I haven't tested it 
yet, but I have this all typed up soi I will send this and then respond to it 
with my results.

Thanks,
Frank

________________________________
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of 
Steve Smith <sasd...@gmail.com>
Sent: Tuesday, March 28, 2023 1:40 PM
To: IBM-MAIN@LISTSERV.UA.EDU <IBM-MAIN@LISTSERV.UA.EDU>
Subject: Re: ASM call by value

What does "didn't work" mean?  What did the CALL expansion look like?

The code might be clearer if you just coded LA R1,=F'3' before the CALL.
Your usage of MF=E is novel, and I'm hesitant to condemn it, but it's
non-standard.

Incidentally, why would you replace =F'1,2,3' on your second example with a
hex string?

sas

On Tue, Mar 28, 2023 at 3:17 PM Frank Swarbrick <frank.swarbr...@outlook.com>
wrote:

> Another typo, of course.
> =X'000000010000000300000003' should be =X'000000010000000200000003'
> ________________________________
> From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf
> of Frank Swarbrick <frank.swarbr...@outlook.com>
> Sent: Tuesday, March 28, 2023 12:52 PM
> To: IBM-MAIN@LISTSERV.UA.EDU <IBM-MAIN@LISTSERV.UA.EDU>
> Subject: Re: ASM call by value
>
> So that didn't work.  But after a lot of fiddling about, here's what works
> for me.  I LE enabled it so it will be reentrant.
>
> ISCICS#  CEEENTRY MAIN=NO
> *        SEE IF WE'RE RUNNING UNDER CICS BY CALLING @@GETCB...
>          CALL  @@GETCB,MF=(E,=F'3') ...WITH VALUE INTEGER 3
>          CEETERM RC=(15)
> *
> PPA      CEEPPA
>          CEEDSA ,
>          CEECAA ,
>          END   ISCICS#
>
> By using the execute format of the CALL macro, assuming all of the fields
> are to be passed by value, you can place them, in order, in the execute
> literal (or whatever its called that follows the 'E').
>
> So, for example, if you wanted to call like the C statement "F(1,2,3)" you
> could do:
>          CALL  F,MF=(E,=X'000000010000000300000003')
> Or, of course, you could refer do a DC group instead of using a literal.
>
> Perhaps this will help others.
>
> Frank
>
>

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

----------------------------------------------------------------------
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