Joined: 22 Apr 2006 Posts: 6258 Location: Mumbai, India
I do not speak assembler much, little did I know..
1. You can issue a CALL macro call in your Assembler program. With this method you also need to include an INCLUDE command in a link file for the module you want to link to. When the Linker processes the INCLUDE command, it does not actually include the COBOL module, but instead generates and includes a small Assembler module. When the CALL is executed at run time, the Assembler module loads and links to the COBOL module.
2. You can issue a LOAD macro call in your Assembler program. Again, the LOAD macro does not load the COBOL module directly, but instead creates and loads an Assembler module the address of which is returned by the LOAD. You then issue a BALR instruction specifying this address. The Assembler module then performs the dynamic link to the COBOL module. Note that if you use this option you must set the high bit in the last parameter address to the number of parameters being passed so that the COBOL program can determine the correct number of parameters.
THX Anuj. I have already used LOAD and BALR. my program is running after using LM R14,R3,SAVEAREA+4, but R1 has the parameter. after using that code my all registers are correpted except R15. please help
Joined: 06 Jun 2008 Posts: 8233 Location: Dubuque, Iowa, USA
If you haven't reviewed the manual Writing ILC Applications SA22-7563, you need to do so. There's an entire chapter on calling COBOL programs from Assembler, with details on LE-conforming and non-LE-conforming routines.
i am getting the error
A storage reference exception, S0C4, occurred during execution of
my code is
LOAD EP=Z17DIST,ERRET=ERROR1 Load the programs
ST R0,Z17ADDR Store Addr
CALL_Z17 SR R5,R5
ST R5,Z17LENGTH calculate the length
* LA R1,Z17START