Doesn't the NOSTART compiler option prevent the "normal" C startup code 
(CEESTART) from being generated, and thus makes you provide your own startup 
logic?  Does your C "main" provide that logic for itself?

I also notice you are using Systems Programming C with (DEF(USE_SPC), so that 
means you are providing environment setup yourself, correct?

Peter

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Pierre Fichaud
Sent: Tuesday, May 10, 2016 4:58 PM
To: [email protected]
Subject: Assembler ATTACHing C

I have an assembler program that creates a sub-task using ATTACHX. 
It sets up a parameter list, pointed to by R01, for the sub-task.

The C code is a main program and so has main (int argc, char *argv[])
It has  #pragma environment(main)
The program is compiled with SS,LIS,SO,OPT,RENT,LO,NOSTART,DEF(USE_SPC)

When I attempt to get at argc and argv, R01 does not point to the right place. 
So I forced an S0C4 at the very beginning of the C program and got an SVC dump.

The system trace table clearly shows the ATTACH SVC entry with R01 pointing to 
the correct place.
TCBFSA of the ATTACHed task points to a save area and the value of R01 is 
correct.

The C sub-task code has prolog code that is called with a BALR  R15,R15 and 
this must be modifying R01.

I'm wondering if someone has done this before and got it to work.
This C code has to be a sub-task and there is too much C code to rewrite.

Any help will be greatly appreciated.
Thanks in advance, Pierre.

--


This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.


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

Reply via email to