×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Cobol calls Assembler subroutine

Cobol calls Assembler subroutine

Cobol calls Assembler subroutine

(OP)
Hi,
  Please anyone help me to understand how cobol pass values to assembler subroutine and it gets back.I am looking for manual also.
   

RE: Cobol calls Assembler subroutine

Please post O/S and COBOL vendor and version.  And are you working with the COBOL source or the assembler source?

RE: Cobol calls Assembler subroutine

(OP)
Hi,
   I am using XP2000.I am working in IBM COBOL.The assembler subroutine is already there,i want to modify something in that assembler subroutine.So i am trying to understand the process how cobol calls assembler,how it pass the value and it gets back.  

RE: Cobol calls Assembler subroutine

I am not familliar with XP2000.  Is this an IBM mainframe?

RE: Cobol calls Assembler subroutine

Or do you mean Windows XP/2000 ?

RE: Cobol calls Assembler subroutine

And which "IBM COBOL"?

RE: Cobol calls Assembler subroutine

(OP)
I mentioned Windows XP/2000,i am working on COBOL-85.

RE: Cobol calls Assembler subroutine

RM COBOL-85...anyway this concept isn't much different compared to what your caller is, for all subroutines use these.

Variables are passed either by value or by reference.  This is probably what you will be most concerned with.  The COBOL calling program will need to match the subroutine in how it is called.

A "By Value" reference is copied to an internal reference in the function.  If it's not set as a constant, it can be changed, but changes will not be reflected outside of the function.

A "By Reference" reference is passed via pointer reference.  It can be changed, and the change will be reflected in the main program after the call.

There are also many other methods regarding the order/way parameters are passed to subroutines.  You will need to match this in the subroutine with how RM-COBOL handles things.  But with the way your post reads, you are modifying and not creating, so this should not be a concern for you.

Measurement is not management.

RE: Cobol calls Assembler subroutine

manni05,
It's been a long time since I have done this but your problem brings back some memories. Yes I did something like this a long time ago. Cobol calling assembler or RPG and vice versa.

I think your problem here can be summarized as:

1. Understanding the linkage between program languages. This is a big topic because you have to understand how data is shared. Just like Glenn said data can be passed by reference, value and also by content, either statically or dynamically.

2. Know how the parameters are being passed and received and the structures of the parameters. Know what is the common area being used by both program (sometimes they called it data areas).

3. If you are going to change something in assembler then do it in assembler and not in cobol. If you are going to change the structure of a parameter then you will have to do it in both programs because they need to match or you will get errors.

Hope this helps.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close