Frank,

I just re-tested my suggestion and you are right, it DOES NOT work [not to 
mention the wrong location for A-POINTER, as it should be in WORKING-STORAGE 
rather than in LINKAGE]. This made me curious as I vaguely remember dealing 
with a variable p-list in COBOL.  It turns out I was calling a simple Assembler 
subroutine, below, to return back the registers.

Apologies for mis-information,
-Victor- 

          YREGS                                                       
COB#REGS  CSECT                                                       
COB#REGS  AMODE ANY                                                   
COB#REGS  RMODE ANY                                                   
*
* Sample invocation:                                                  
*        CALL 'COB#REGS' USING R0-R15  (ARRAY OF 16 FULLWORDS)        
*
         ST    R15,12+4(,R13)                 - SAVE R15              
         USING PARMS,R1                                               
         L     R15,PARM_PTR                   - PARM POINTER          
         USING PARM,R15                                               
         STM   R0,R15,PARM                    - PASS REGS             
         MVC   PARM+4*15(4),12+4(R13)         -  ... AND FIX R15      
*                                                                     
         SR    R15,R15                        - ALWAYS "OK"           
         BR    R14                            - DONE                  
*
PARMS    DSECT                                                        
PARM_PTR  DS A                                                        
*                                                                     
PARM_D   DSECT                                                        
PARM      DS (16)A                                                    
*                                                                     
         END                                                          

============================================================================================
It was.  Program 'callee' in my example below.  (My example has three programs; 
'callopt' calls 'callee'.  'callee' should call 'print-string' only for parms 
that were passed from program 'callopt'.  I did not show the code for 
'print-string', as it is not being passed a variable number of parameters.


Frank

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to