Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Parameter list in Assembler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Avinashhlg

New User


Joined: 05 Jan 2010
Posts: 7
Location: Bangalore

PostPosted: Tue Jan 05, 2010 4:50 pm    Post subject: Parameter list in Assembler
Reply with quote

To accept the data from parameters passed from COBOL program to assembler, we know that R1 will have the address of the parameter, but I have difficulty in identifying the length of the data. How will I able to get the length of parameter passed?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Jan 05, 2010 5:09 pm    Post subject: Reply to: Parameter list in Assembler
Reply with quote

You will not!
review the LE interlanguage reference for the parameter passing rules

note:
R1 will point to the list of the addresses of the parameters
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Tue Jan 05, 2010 5:12 pm    Post subject:
Reply with quote

Actually, register 1 does not have the address of the parameter -- register 1 has the address of the parameter list. This is a significant difference.

What does this mean?
Quote:
I have difficulty in identifying the length of the data
Are you referring to the number of parameters?
Are you referring to the length of an individual parameter?
Back to top
View user's profile Send private message
Avinashhlg

New User


Joined: 05 Jan 2010
Posts: 7
Location: Bangalore

PostPosted: Tue Jan 05, 2010 5:22 pm    Post subject: Reply to: Parameter list in Assembler
Reply with quote

Yes, iam referring to the length of the indivisual parameter. Is there any way by which I can extract the exact data passed from the calling program. The problem is that I dont know the length of the data I receive in my assembler code.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Jan 05, 2010 5:30 pm    Post subject:
Reply with quote

A scenario could be :

UPON ENTRY R1 POINTS TO ADDRESS OF PLIST PLIST+0 : LENGTH OF PARM
PLIST+2 : START OF PARM

Another scenario is :

R1 POINTS TO ADDRESS OF PLIST
PLIST CONTAINS POINTERS TO PARAMETERS WITH LENGTH+DATA
PLIST ENDS WITH X'80',AL3(0)
Back to top
View user's profile Send private message
Avinashhlg

New User


Joined: 05 Jan 2010
Posts: 7
Location: Bangalore

PostPosted: Tue Jan 05, 2010 5:37 pm    Post subject:
Reply with quote

I could see only the data in the plist and not length.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Jan 05, 2010 5:47 pm    Post subject: Reply to: Parameter list in Assembler
Reply with quote

cobol follows the assembler conventions
it' s Your concern to know the structure of the data You are dealing with


just to show a different scenario
in PL/I
with the OPTIONS ASM clause for parameter passing,
PL/I will use the assembler convention ==> data address
without the OPTIONS ASM clause,
PL/I will use it's internal scheme ==> locator descriptor address
where all the info about the variable is kept ( length,type,..., content)
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Jan 05, 2010 5:47 pm    Post subject:
Reply with quote

Maybe there is no length, cause the parameter is always fixed length.
The called routine, and the calling routine MUST know that of course.

But thats a stupid way of supplying parameter lists.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Tue Jan 05, 2010 5:48 pm    Post subject:
Reply with quote

Pass the length as a parameter.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Jan 05, 2010 6:09 pm    Post subject:
Reply with quote

http://www.ibmmainframes.com/post-160331.html
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Jan 05, 2010 7:19 pm    Post subject: Reply to: Parameter list in Assembler
Reply with quote

Although the following discussion is not quite the same, it might be helpful -

http://www.ibmmainframes.com/viewtopic.php?t=44937&highlight=

Bill
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jan 06, 2010 1:01 am    Post subject:
Reply with quote

Hello,

If your goal is to write a generic module that will handle "anything" that arrives, i suspect you will expereience considerable frustration. . .

If the data has a structure, use the same in both the calling and called modules and there is no need to determine length.

Why do you believe you need to determine the length dynamically?

Possibly i have misunderstood something. . . icon_confused.gif
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Thu Jan 07, 2010 3:42 pm    Post subject:
Reply with quote

Hi Avinashhlg !

The lengt depends on the structure of the data you would receive.

If there are several structures, the best is, as said before, to define al field at the first point of the structure which contains the length.

Also a field with a FunctionCode would be useful. Several parms indicate several functions.

So, as everyone told before, it's your turn to handle this. If there is nothing that fits your requirement, just create it by yourselfe.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm
No new posts reorder screeNS using SWAP LIST? mrsidhu12 TSO/ISPF 5 Thu Sep 01, 2016 2:19 pm
No new posts Getting list of tables defined under ... kishpra DB2 2 Wed Aug 24, 2016 10:36 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us