View previous topic :: View next topic |
Author |
Message |
Brian Beginner
Joined: 12 Aug 2003 Posts: 95 Topics: 6
|
Posted: Wed Aug 13, 2003 6:39 am Post subject: Assembler Parameter return |
|
|
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 |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 699 Topics: 63 Location: USA
|
Posted: Wed Aug 13, 2003 7:14 am Post subject: |
|
|
Are you writing the assembler code? In that case you can supply the relevant code for analysis.
Diba. |
|
Back to top |
|
|
Brian Beginner
Joined: 12 Aug 2003 Posts: 95 Topics: 6
|
Posted: Wed Aug 13, 2003 9:53 am Post subject: |
|
|
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 |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 699 Topics: 63 Location: USA
|
Posted: Wed Aug 13, 2003 11:31 pm Post subject: |
|
|
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 |
|
|
Brian Beginner
Joined: 12 Aug 2003 Posts: 95 Topics: 6
|
Posted: Thu Aug 14, 2003 4:39 am Post subject: |
|
|
Well it was a problem of improper data conversion. I did not convert the zoned decimal to packed.
Fixed now. |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 699 Topics: 63 Location: USA
|
Posted: Thu Aug 14, 2003 4:55 am Post subject: |
|
|
Great job and Good luck in your future assembler assignments. |
|
Back to top |
|
|
|
|