MVS Jan 2005.p65 - CBT Tape
MVS Jan 2005.p65 - CBT Tape
MVS Jan 2005.p65 - CBT Tape
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
* R9 : work register *<br />
* R1Ø - R11 : reserved (future base register expansion) *<br />
* R12 : base register *<br />
* R13 : DSA/workarea address *<br />
* R14 - R15 : work registers, return address and return code, but *<br />
* generally available for use by calls to system *<br />
* functions *<br />
*---------------------------------------------------------------------*<br />
* Routine: ATTACH *<br />
* *<br />
* Function: To provide <strong>MVS</strong> ATTACH capabilities from an IBM *<br />
* C/C++ program. *<br />
* *<br />
* Arguments: ATTACH program name address (right pad with blanks) *<br />
* ATTACH() function workarea address. This workarea *<br />
* must be a minimum of 256 bytes plus four bytes *<br />
* for each optional parm that is passed. It *<br />
* should not be modified by the calling program or *<br />
* used for any other ATTACH() calls while this *<br />
* task is active. *<br />
* ECB area address (or NULL) *<br />
* TCB area address (or NULL) *<br />
* TASKLIB DCB area address (or NULL) *<br />
* Optional parms to be passed to the attached program. *<br />
* The last parm address will have the X'8Ø' flag *<br />
* set. You can pass up to 256 optional parms. *<br />
* *<br />
* Return: Ø if the ATTACH is successful *<br />
* -7 ATTACH failed. If an ECB area address has been *<br />
* provided, the ECB area contains the ATTACH *<br />
* return code. *<br />
* -8 incorrect minimum number of parms. The ATTACH() *<br />
* function call requires a minimum of five parms. *<br />
* -9 no parms were detected on entry to ATTACH() *<br />
* *<br />
* C usage: i = ATTACH(&pgm_name, &attach_workarea_addr, *<br />
* &ecb, &tcb, &tasklib_dcb, *<br />
* &opt_parm1, &opt_parm2, ... , &opt_parmn); *<br />
*---------------------------------------------------------------------*<br />
ATTACH CSECT<br />
ATTACH AMODE 31<br />
ATTACH RMODE ANY<br />
EDCPRLG BASEREG=R12,DSALEN=WORKLEN<br />
USING ATTAWORK,R13 Addressability to temp storage<br />
*---------------------------------------------------------------------*<br />
LTR R1,R1 Parms ok?<br />
BZ RETNEGØ9 No - return -9<br />
LR R9,R1 Copy parm address<br />
L R2,Ø(,R9) Get buffer address<br />
N R2,=X'8ØØØØØØØ' Turn off address value<br />
© 2005. Reproduction prohibited. Please inform Xephon of any infringement.<br />
35