IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Parameter list in Assembler


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jan 05, 2010 5:09 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jan 05, 2010 5:12 pm
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
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: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Jan 05, 2010 5:30 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jan 05, 2010 5:47 pm
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: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Jan 05, 2010 5:47 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jan 05, 2010 5:48 pm
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: 2481
Location: Netherlands, Amstelveen

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

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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Jan 05, 2010 7:19 pm
Reply with quote

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

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

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

Moderator Emeritus


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

PostPosted: Wed Jan 06, 2010 1:01 am
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: 771
Location: Germany

PostPosted: Thu Jan 07, 2010 3:42 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts Finding Assembler programs PL/I & Assembler 5
No new posts Demand with DEADLINE TIME parameter CA Products 4
Search our Forums:

Back to Top