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