How to get the Data back from assembler in Cobol.



High Level Assembler(HLASM) for MVS & VM & VSE

How to get the Data back from assembler in Cobol.

Postby Ramkumarsony » Tue Jul 22, 2008 10:27 pm

I am sending some data to a assembler program from a cobol. so the address of address of parm list will be stored in register one(R1). suppose after doin some changes how to retrieve the data back to the cobol program. i have used the following code for getting the data in assembler to map the address of parms in register 5. Then used a "dsect" to get the data.

L R5,0(R1)
USING VALDSECT,R5
.
.
.
VALDSECT DSECT
DATAS 0CL20
DATA1 CL10
DATA2 CL10
.
.
Now I have to send this data back to the cobol. can anyone plz give me the piece of code to do so.
Ramkumarsony
 
Posts: 11
Joined: Wed Jun 25, 2008 10:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the Data back from assembler in Cobol.

 

Re: How to get the Data back from assembler in Cobol.

Postby dick scherrer » Wed Jul 23, 2008 12:09 am

Hello Ramkumarsony and welcome to the forums,

Do you know how to call a cobol sub-program from a cobol main program?

Let's say that the sub-program is given some numbers and is to send back an "answer". How does the cobol sub-program give back the answer?

Assembler works the same way. The calling program establishes addressability to the parm field(s) and the called module simply uses the fields.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: How to get the Data back from assembler in Cobol.

Postby Ramkumarsony » Wed Jul 23, 2008 10:18 am

Hi D.Sch.....
Thanks alot.. :) So since we are manipulating the data by using their address, any change we made will get reflected in cobol also(Because its a "Call by reference" calling) so after manupulating the data if i map the address of data to the register 1(R1) i can retrieve the changed data in cobol. right?
Ramkumarsony
 
Posts: 11
Joined: Wed Jun 25, 2008 10:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the Data back from assembler in Cobol.

Postby dick scherrer » Thu Jul 24, 2008 2:21 am

Hello,

You won't actually "retrieve" anything in COBOL - when the "move" happens in assembler, the actual receiving field is the field within the cobol program.

When your assembler code begins, one of the first things done is to establish this addressability. If your assembler code "sees" the parm correctly, that is all you should need to do.

so after manupulating the data if i map the address of data to the register 1(R1
You will have already done this and will not need to do it again.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: How to get the Data back from assembler in Cobol.

Postby Ramkumarsony » Thu Jul 24, 2008 9:47 am

ok Dick scherrer.. thanks... :)
Ramkumarsony
 
Posts: 11
Joined: Wed Jun 25, 2008 10:12 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post