Perhaps the "weird way" could be documented as an appropriate way to pass arguments by value instead of the standard by reference. Then it would no longer be weird! ________________________________ From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of Steve Smith <sasd...@gmail.com> Sent: Wednesday, March 29, 2023 9:16 PM To: IBM-MAIN@LISTSERV.UA.EDU <IBM-MAIN@LISTSERV.UA.EDU> Subject: Re: ASM call by value
Good job. You could have a future as an assembler programmer, because you pay attention to the details. Your weird way is interesting because it is correct, but... it is not idiomatic. So it will freak out most assembler programmers. That's often not a good thing, but often is not always. sas On Wed, Mar 29, 2023 at 7:53 PM Frank Swarbrick <frank.swarbr...@outlook.com> wrote: > 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. > > ---------------------------------------------------------------------- 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