My C is rusty... I need to review pointer/address-of syntax. The idea for the 3rd argument was to show one "passed by reference"; in any case modifiable by the subroutine.
But where did x and y come from? sas On Sun, Mar 26, 2023 at 7:53 PM Frank Swarbrick <frank.swarbr...@outlook.com> wrote: > Also, "*k = x + y". > ________________________________ > From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf > of Frank Swarbrick <frank.swarbr...@outlook.com> > Sent: Sunday, March 26, 2023 5:52 PM > To: IBM-MAIN@LISTSERV.UA.EDU <IBM-MAIN@LISTSERV.UA.EDU> > Subject: Re: ASM call by value > > I'm guessing he meant "int *k" rather than "&int k". > > ________________________________ > From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf > of Paul Gilmartin <0000042bfe9c879d-dmarc-requ...@listserv.ua.edu> > Sent: Sunday, March 26, 2023 5:49 PM > To: IBM-MAIN@LISTSERV.UA.EDU <IBM-MAIN@LISTSERV.UA.EDU> > Subject: Re: ASM call by value > > On Sun, 26 Mar 2023 19:35:59 -0400, Steve Smith wrote: > > >I forgot to mention, to pass by value with CALL, you need [a] register[s]. > >e.g.: > >void foo(int i, int j , &int k) > > { > > k = i + j; > > } > > > That shouldn't be legal. In fact, gcc gives me: > cc tinyc.c -o tinyc > tinyc.c:3:25: error: expected parameter declarator > void foo(int i, int j , &int k) > > -- > gil > > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN