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
