I don't know much about the secrets of the LE linkage macros like
EDCPRLG, but:
why are the parameter addresses loaded starting from 4(R1)?
If there is nothing special about the address list and linkage OS,
I would expect
LM R9,R11,0(R1)
not 4(R1)
this should bring the addresses of the 3 parameters to R9, R10 and R11.
R9 = &fullwd2
R10 = &fullwd1
R11 = &rc
Or is there something special about the EDCPRLG, which leads to the
4 bytes offset, what I don't understand?
Kind regards
Bernd
Am 05.04.2013 23:27, schrieb Thomas H Puddicombe:
Should R5 be instead R10?
If so, whose foot was R5 pointing to? <g,d,r>
Tom
Vacation Notice: None
Tom Puddicombe
Mainframe Performance & Capacity Planning
CSC
31 Brookdale Rd, Meriden, CT 06450
ITIS | (860) 428-3252 | [email protected] | www.csc.com
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose.
From: Scott Ford <[email protected]>
To: [email protected]
Date: 04/05/2013 04:58 PM
Subject: C and Assembler
Sent by: IBM Mainframe Discussion List <[email protected]>
Guys:
I have an Assembler routine below i want to call in C. I have changed it
to be LE conforming.
GETSP231 START 0
GETSP231 AMODE 31
GETSP231 RMODE ANY
EDCPRLG BASEREG=R12,DSALEN=WORKLEN
USING LGINWORK,R13 SAVEAREA AND LOCAL VARS
*-------------------------------------------------------------
* LOADS STG AMOUNT INTO R9, STG ADDR INTO R10 AND RC IN R11
*-------------------------------------------------------------
LM R9,R11,4(R1) LOAD ADDRESS STG AMT, ADR & RC
L R9,0(R9) STG AMT - S/B 4K MULTIPLE
MODESET KEY=ZERO,MODE=SUP GO INTO SUPERVISOR MODE
STORAGE OBTAIN,LENGTH=(9),SP=231,LOC=ANY
ST R1,0(R5) RETURN ADDR, IF ANY
ST R15,0(R11) RETURN CODE, OK IF ZERO
MODESET KEY=NZERO,MODE=PROB BACK TO MORTALITY
*-------------------------------------------------------------
EDCEPIL
LTORG
LGINWORK EDCDSAD
WORKLEN EQU *-LGINWORK
YREGS
END GETSP231
In C is did this:
/*--------------------------------*/
#include <stdio.h>
#include <string.h>
#pragma linkage(GETSP231,OS)
int rc;
unsigned long int fullwd2;
char fullwd1[8];
main()
{
fullwd2 = 102400;
rc = GETSP231(&fullwd2,&fullwd1,&rc);
printf("Getsp231 rc: %d\n",rc);
if (rc == 0 )
{ printf("Getsp231 allocation worked\n");
printf("Allocation of: %d\n,",fullwd2);
printf("Allocation at: %s\n,",fullwd1);
}
else
{ printf("Getsp231 allocation failed\n");
}
}
I get a RC=0 which is great, but i should get the address passed back to C
and I dont see it ..
So ...i call upon the great C crystal ball ...
As always a big thanks,
Scott J Ford
Software Engineer
http://www.identityforge.com/
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN