MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Assembler Parameter return

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Brian
Beginner


Joined: 12 Aug 2003
Posts: 95
Topics: 6

PostPosted: Wed Aug 13, 2003 6:39 am    Post subject: Assembler Parameter return Reply with quote

How does assembler return a value to the called cobol program using one of the variables used as a parameter itself .

Code:


CALL 'ASBABCDE' USING X,Y,Z



How can i make assembler to return the processed value in X Rolling Eyes
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 699
Topics: 63
Location: USA

PostPosted: Wed Aug 13, 2003 7:14 am    Post subject: Reply with quote

Are you writing the assembler code? In that case you can supply the relevant code for analysis.

Diba.
Back to top
View user's profile Send private message Send e-mail
Brian
Beginner


Joined: 12 Aug 2003
Posts: 95
Topics: 6

PostPosted: Wed Aug 13, 2003 9:53 am    Post subject: Reply with quote

This is the assembler code. Basically it takes 3 packed decimal fields , does some checking and returns a value to the first parameter passed.

Code:

ASMCALL        CSECT
                      STM         14,12,12(13)
                       BALR       12,0
                       USING       *,12
                       LM            2,4,0(1) * load the parameters
                       L               6,0(0,2) * get all into registers
                       L               7,0(0,3)
                       L               8,0(0,4)
                       USING       AMILINK,10
                       *** SOME PROCESSING***
                       LM             14,12,12(13) ** return to caller
                       XR             15,15            ** zero return code
                       BR              14                ** branch
*
AMILINK           DSECT
AMV                 DS        PL3
AMI                  DS        PL3
AMX                  DS        PL3
                         END
                         END


After execution I expect the result to be in AMIGA DS PL3
How can i map this to the first parameter in my parameter list. Hope my question is clear.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 699
Topics: 63
Location: USA

PostPosted: Wed Aug 13, 2003 11:31 pm    Post subject: Reply with quote

Brian,

I am learning assembler so don't know if the solution will work or not. Try -
MVC 0(3,2),AMIGA * Returning 3 bytes from AMIGA3 to firat parm

Diba.
Back to top
View user's profile Send private message Send e-mail
Brian
Beginner


Joined: 12 Aug 2003
Posts: 95
Topics: 6

PostPosted: Thu Aug 14, 2003 4:39 am    Post subject: Reply with quote

Well it was a problem of improper data conversion. I did not convert the zoned decimal to packed. Mr. Green

Fixed now.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 699
Topics: 63
Location: USA

PostPosted: Thu Aug 14, 2003 4:55 am    Post subject: Reply with quote

Great job and Good luck in your future assembler assignments.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group