OK, the following three examples all seem to work. I dare say you are correct
about example 1 being unexpected usage of the execute mode. I only came up
with it my looking at an example that wasn’t working and seeing that putting my
value there directly made it work. But it wasn’t meant to be an example of
good coding.
*
CALL1 CALL ,(,),MF=L
*
ISCICS# CEEENTRY MAIN=NO
*
* SEE IF WE'RE RUNNING UNDER CICS BY CALLING @@GETCb
* WITH “VALUE” OF FULLWORD 3.
*
* EXAMPLE 1 (MY WEIRD WAY):
CALL @@GETCB,MF=(E,=F'3')
*
* EXAMPLE 2 (LOAD R1 DIRECTLY WITH ADDRESS OF AREA
* CONTAINING 3, THEN JUST CALL):
LA 1,=F'3'
CALL @@GETCB
*
* EXAMPLE 3 (LOAD REGISTER (2) WITH VALUE,
* THEN CALL WITH THAT REGISTER AS THE ARGUMENT:
LHI 2,3
CALL @@GETCB,((2)),MF=(E,CALL1)
*
CEETERM RC=(15)
*
PPA CEEPPA
CEEDSA ,
CEECAA ,
END ISCICS#
I should note that I am not a systems programmer, or even an “assembler
programmer”. I am a COBOL programmer who dabbles in assembler occasionally.
So I am bound to get a lot of things wrong.
I think I’ll do with #2, since that generates the least amount of code and is
still fairly simple to read.
As for why I used X'0000000010000000200000003’ instead of F'1,2,3' in another
example, it’s because I didn’t know of the availability of using “comma
separated fullword” literals.
________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf of
Steve Smith <[email protected]>
Sent: Wednesday, March 29, 2023 3:20 PM
To: [email protected] <[email protected]>
Subject: Re: ASM call by value
Example 1 looks as I expected, and I'd expect it to work.
You're close on Example 3, you don't want to specify MF in that case.
What you want is the call to go to the subroutine with R1->F'3'. In Ex. 1,
R2 contains the 3, it's stored in the parmlist addressed by R1 (via MF=E).
In Ex. 3, you're doing the parmlist setup yourself, so don't code the MF
(or any parameters) and CALL will not mess with R1.
sas
On Wed, Mar 29, 2023 at 5:02 PM Frank Swarbrick <[email protected]>
wrote:
> 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
>
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN