On Wed, 1 May 2013 10:27:44 -0500, Etienne Thijsse wrote:

>I am trying to call an assembler function from C:

...

>Assembler code (bla1.s):
>
>BLA     CSECT
>BLA     MODE  ANY
>
>           SAVE   (14,12)
>           BALR    3,0
>           USING  *,3
>           ST        13,SAVE+4      <<<<< crashes here
>
>*         todo: add useful code here
>
>           L           15,=X'01'
>           L           13,SAVE+4
>           RETURN (14,12),RC=(15)
>
>SAVE   DS       18F
>           END
>
>So the only code in this assembler source is the "standard linkage" 
>stuff, which I got from the "MVS Assembler Language"  book.

The linkage conventions are documented in chapter 2 of the MVS 
Assembler Services Guide.  You have not used the sample code 
provided in that manual.  The samples use GETMAIN to obtain a new 
save area.  The address of the new save area needs to be placed in 
Register 13 so that it can be used by any programs that you might 
call.  Otherwise it is of no use.

-- 
Tom Marchant

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to