Re: HLASM calling C DLL

2019-07-03 Thread Joseph Reichman
I think I’ll compile the code on visual studio with #ifdef  
Then upload it 

Thanks 




> On Jul 3, 2019, at 2:46 AM, Mike Hochee  wrote:
> 
> Excellent presentation!
> 
> Thank you Charles
> 
> 
> From: IBM Mainframe Assembler List  on 
> behalf of Joseph Reichman 
> Sent: Tuesday, July 2, 2019 9:38 PM
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Re: HLASM calling C DLL
> 
> Thanks
> 
> -Original Message-
> From: IBM Mainframe Assembler List  On 
> Behalf Of Jon Perryman
> Sent: Tuesday, July 2, 2019 9:38 PM
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Re: HLASM calling C DLL
> 
> You can get quickly up to speed on IBM's DLL implementation with the older 
> share presentation at ftp://ftp.software.ibm.com/s390/zos/le/an8130.pdf which 
> shows both sides with examples in several languages (including HLA). For me, 
> it's been several years but it don't remember it being difficult.
>On Tuesday, July 2, 2019, 02:51:38 PM PDT, Joseph Reichman 
>  wrote:
> 
> I got a bounce back trying to reply too many lines
> 
> 
> 
> Charles
> 
> 
> 
> Thanks for the Hyperlink example but I am looking for HLASM doing the 
> LoadLibrary and GetProcAddress


Re: C DLL Code from Assembler

2019-07-03 Thread Tony Harminc
On Tue, 2 Jul 2019 at 17:24, Joseph Reichman  wrote:

> I am hoping to have the Assembler Started task code call a C DLL,  On the 
> Windows end it would be C/C+ code calling the
> DLL obviously there are differences because of the platform but I am guessing 
> hose call be handled by #IFDEF
>
> In Windows Loading the DLL is a LoadLibrary Api then GetProcAddress to get 
> the exports
>
> I am not sure how to do this in Assembler is there a LoadLibrary Macro or a 
> GetProcAddress macro to call the exported
> function

DLLs are discussed in the LE book _Language Environment Programming
Guide_ in Chapter 4. Most of the examples and discussions are about C,
but there are some brief assembler bits. And there is a discussion of
assembler considerations (not just for DLLs) in Chapter 29, including
the various macros you need.

To be clear, HLASM *is* explictly a supported language for both
writing and invoking DLLs under LE. See "Support for DLLs" at the very
start of Chapter 4.

I haven't played with this for many years, and am not current, but
other people on this list have written about it - maybe John McKown?
And there was the Trainer's Friend guy (Steve Comstock?), who gave
courses on this and related LE matters. He made his course materials
available for sale when he closed the business. Maybe they are still
out there? Ah - I see some of it is now on Amazon. Not free, but maybe
a good deal. http://www.trainersfriend.com/zOS.shtml I have no
connection, etc...

Tony H.


Re: C DLL Code from Assembler

2019-07-03 Thread Joseph Reichman
I saw reference to DLL’s in the XL C bookshelf 

Unlike Windows there doesn’t seem to be a DLLMAIN function 

Thanks 




> On Jul 3, 2019, at 3:46 PM, Tony Harminc  wrote:
> 
>> On Tue, 2 Jul 2019 at 17:24, Joseph Reichman  wrote:
>> 
>> I am hoping to have the Assembler Started task code call a C DLL,  On the 
>> Windows end it would be C/C+ code calling the
>> DLL obviously there are differences because of the platform but I am 
>> guessing hose call be handled by #IFDEF
>> 
>> In Windows Loading the DLL is a LoadLibrary Api then GetProcAddress to get 
>> the exports
>> 
>> I am not sure how to do this in Assembler is there a LoadLibrary Macro or a 
>> GetProcAddress macro to call the exported
>> function
> 
> DLLs are discussed in the LE book _Language Environment Programming
> Guide_ in Chapter 4. Most of the examples and discussions are about C,
> but there are some brief assembler bits. And there is a discussion of
> assembler considerations (not just for DLLs) in Chapter 29, including
> the various macros you need.
> 
> To be clear, HLASM *is* explictly a supported language for both
> writing and invoking DLLs under LE. See "Support for DLLs" at the very
> start of Chapter 4.
> 
> I haven't played with this for many years, and am not current, but
> other people on this list have written about it - maybe John McKown?
> And there was the Trainer's Friend guy (Steve Comstock?), who gave
> courses on this and related LE matters. He made his course materials
> available for sale when he closed the business. Maybe they are still
> out there? Ah - I see some of it is now on Amazon. Not free, but maybe
> a good deal. http://www.trainersfriend.com/zOS.shtml I have no
> connection, etc...
> 
> Tony H.


Re: C DLL Code from Assembler

2019-07-03 Thread John Melcher
There isn't.  You must instantiate Language Environment by either making your 
Assembler Language routine the main() or calling it from a LE enabled "main".

 void  main(char * parm)
{
Int rc;
 rc = Asmfunc();
}

-Original Message-
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of Joseph Reichman
Sent: Wednesday, July 3, 2019 2:51 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: C DLL Code from Assembler

*** External email: Verify sender before opening attachments or links ***


I saw reference to DLL’s in the XL C bookshelf

Unlike Windows there doesn’t seem to be a DLLMAIN function

Thanks




> On Jul 3, 2019, at 3:46 PM, Tony Harminc  wrote:
>
>> On Tue, 2 Jul 2019 at 17:24, Joseph Reichman  wrote:
>>
>> I am hoping to have the Assembler Started task code call a C DLL,  On 
>> the Windows end it would be C/C+ code calling the DLL obviously there 
>> are differences because of the platform but I am guessing hose call 
>> be handled by #IFDEF
>>
>> In Windows Loading the DLL is a LoadLibrary Api then GetProcAddress 
>> to get the exports
>>
>> I am not sure how to do this in Assembler is there a LoadLibrary 
>> Macro or a GetProcAddress macro to call the exported function
>
> DLLs are discussed in the LE book _Language Environment Programming 
> Guide_ in Chapter 4. Most of the examples and discussions are about C, 
> but there are some brief assembler bits. And there is a discussion of 
> assembler considerations (not just for DLLs) in Chapter 29, including 
> the various macros you need.
>
> To be clear, HLASM *is* explictly a supported language for both 
> writing and invoking DLLs under LE. See "Support for DLLs" at the very 
> start of Chapter 4.
>
> I haven't played with this for many years, and am not current, but 
> other people on this list have written about it - maybe John McKown?
> And there was the Trainer's Friend guy (Steve Comstock?), who gave 
> courses on this and related LE matters. He made his course materials 
> available for sale when he closed the business. Maybe they are still 
> out there? Ah - I see some of it is now on Amazon. Not free, but maybe 
> a good deal. 
> http://TOC.ASG.COM:8080/?dmVyPTEuMDAxJiY1NDU1NmVlYzI3Nzk4NzhlZT01RDFEMDcxOV85OTE1N185NjNfMSYmNTBjMjY5NGQ5NGMxYTRlPTEyMzImJnVybD1odHRwJTNBJTJGJTJGd3d3JTJFdHJhaW5lcnNmcmllbmQlMkVjb20lMkZ6T1MlMkVzaHRtbA==
>  I have no connection, etc...
>
> Tony H.


Re: C DLL Code from Assembler

2019-07-03 Thread Joseph Reichman
Well there is the first #ifdef


> On Jul 3, 2019, at 4:29 PM, John Melcher 
> <0a33cad2fca2-dmarc-requ...@listserv.uga.edu> wrote:
> 
> There isn't.  You must instantiate Language Environment by either making your 
> Assembler Language routine the main() or calling it from a LE enabled "main".
> 
> void  main(char * parm)
> {
>Int rc;
> rc = Asmfunc();
> }
> 
> -Original Message-
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] 
> On Behalf Of Joseph Reichman
> Sent: Wednesday, July 3, 2019 2:51 PM
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Re: C DLL Code from Assembler
> 
> *** External email: Verify sender before opening attachments or links ***
> 
> 
> I saw reference to DLL’s in the XL C bookshelf
> 
> Unlike Windows there doesn’t seem to be a DLLMAIN function
> 
> Thanks
> 
> 
> 
> 
>>> On Jul 3, 2019, at 3:46 PM, Tony Harminc  wrote:
>>> 
>>> On Tue, 2 Jul 2019 at 17:24, Joseph Reichman  wrote:
>>> 
>>> I am hoping to have the Assembler Started task code call a C DLL,  On 
>>> the Windows end it would be C/C+ code calling the DLL obviously there 
>>> are differences because of the platform but I am guessing hose call 
>>> be handled by #IFDEF
>>> 
>>> In Windows Loading the DLL is a LoadLibrary Api then GetProcAddress 
>>> to get the exports
>>> 
>>> I am not sure how to do this in Assembler is there a LoadLibrary 
>>> Macro or a GetProcAddress macro to call the exported function
>> 
>> DLLs are discussed in the LE book _Language Environment Programming 
>> Guide_ in Chapter 4. Most of the examples and discussions are about C, 
>> but there are some brief assembler bits. And there is a discussion of 
>> assembler considerations (not just for DLLs) in Chapter 29, including 
>> the various macros you need.
>> 
>> To be clear, HLASM *is* explictly a supported language for both 
>> writing and invoking DLLs under LE. See "Support for DLLs" at the very 
>> start of Chapter 4.
>> 
>> I haven't played with this for many years, and am not current, but 
>> other people on this list have written about it - maybe John McKown?
>> And there was the Trainer's Friend guy (Steve Comstock?), who gave 
>> courses on this and related LE matters. He made his course materials 
>> available for sale when he closed the business. Maybe they are still 
>> out there? Ah - I see some of it is now on Amazon. Not free, but maybe 
>> a good deal. 
>> http://TOC.ASG.COM:8080/?dmVyPTEuMDAxJiY1NDU1NmVlYzI3Nzk4NzhlZT01RDFEMDcxOV85OTE1N185NjNfMSYmNTBjMjY5NGQ5NGMxYTRlPTEyMzImJnVybD1odHRwJTNBJTJGJTJGd3d3JTJFdHJhaW5lcnNmcmllbmQlMkVjb20lMkZ6T1MlMkVzaHRtbA==
>>  I have no connection, etc...
>> 
>> Tony H.


Re: C DLL Code from Assembler

2019-07-03 Thread Mike Hochee
You might want to consider looking into CEEPIPI, which allows you to initialize 
an LE 'umbrella' from a non-LE conforming program and then control the 
execution of main programs, subprograms, dlls, etc. underneath.

It is documented in chapter 30 of the LE Programming Guide.

HTH,
Mike


From: IBM Mainframe Assembler List  on behalf 
of Joseph Reichman 
Sent: Wednesday, July 3, 2019 4:52 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: C DLL Code from Assembler

Well there is the first #ifdef


> On Jul 3, 2019, at 4:29 PM, John Melcher 
> <0a33cad2fca2-dmarc-requ...@listserv.uga.edu> wrote:
>
> There isn't.  You must instantiate Language Environment by either making your 
> Assembler Language routine the main() or calling it from a LE enabled "main".
>
> void  main(char * parm)
> {
>Int rc;
> rc = Asmfunc();
> }
>
> -Original Message-
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] 
> On Behalf Of Joseph Reichman
> Sent: Wednesday, July 3, 2019 2:51 PM
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Re: C DLL Code from Assembler
>
> *** External email: Verify sender before opening attachments or links ***
>
>
> I saw reference to DLL's in the XL C bookshelf
>
> Unlike Windows there doesn't seem to be a DLLMAIN function
>
> Thanks
>
>
>
>
>>> On Jul 3, 2019, at 3:46 PM, Tony Harminc  wrote:
>>>
>>> On Tue, 2 Jul 2019 at 17:24, Joseph Reichman  wrote:
>>>
>>> I am hoping to have the Assembler Started task code call a C DLL,  On
>>> the Windows end it would be C/C+ code calling the DLL obviously there
>>> are differences because of the platform but I am guessing hose call
>>> be handled by #IFDEF
>>>
>>> In Windows Loading the DLL is a LoadLibrary Api then GetProcAddress
>>> to get the exports
>>>
>>> I am not sure how to do this in Assembler is there a LoadLibrary
>>> Macro or a GetProcAddress macro to call the exported function
>>
>> DLLs are discussed in the LE book _Language Environment Programming
>> Guide_ in Chapter 4. Most of the examples and discussions are about C,
>> but there are some brief assembler bits. And there is a discussion of
>> assembler considerations (not just for DLLs) in Chapter 29, including
>> the various macros you need.
>>
>> To be clear, HLASM *is* explictly a supported language for both
>> writing and invoking DLLs under LE. See "Support for DLLs" at the very
>> start of Chapter 4.
>>
>> I haven't played with this for many years, and am not current, but
>> other people on this list have written about it - maybe John McKown?
>> And there was the Trainer's Friend guy (Steve Comstock?), who gave
>> courses on this and related LE matters. He made his course materials
>> available for sale when he closed the business. Maybe they are still
>> out there? Ah - I see some of it is now on Amazon. Not free, but maybe
>> a good deal.
>> http://TOC.ASG.COM:8080/?dmVyPTEuMDAxJiY1NDU1NmVlYzI3Nzk4NzhlZT01RDFEMDcxOV85OTE1N185NjNfMSYmNTBjMjY5NGQ5NGMxYTRlPTEyMzImJnVybD1odHRwJTNBJTJGJTJGd3d3JTJFdHJhaW5lcnNmcmllbmQlMkVjb20lMkZ6T1MlMkVzaHRtbA==
>>  I have no connection, etc...
>>
>> Tony H.


Re: C DLL Code from Assembler

2019-07-03 Thread Joseph Reichman
Thanks the program ( source ) I would do this ( call the c exports) is one with 
multiple csects I will look up CEEPIPI

Thanks 




> On Jul 3, 2019, at 5:24 PM, Mike Hochee  wrote:
> 
> You might want to consider looking into CEEPIPI, which allows you to 
> initialize an LE 'umbrella' from a non-LE conforming program and then control 
> the execution of main programs, subprograms, dlls, etc. underneath.
> 
> It is documented in chapter 30 of the LE Programming Guide.
> 
> HTH,
> Mike
> 
> 
> From: IBM Mainframe Assembler List  on 
> behalf of Joseph Reichman 
> Sent: Wednesday, July 3, 2019 4:52 PM
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Re: C DLL Code from Assembler
> 
> Well there is the first #ifdef
> 
> 
>> On Jul 3, 2019, at 4:29 PM, John Melcher 
>> <0a33cad2fca2-dmarc-requ...@listserv.uga.edu> wrote:
>> 
>> There isn't.  You must instantiate Language Environment by either making 
>> your Assembler Language routine the main() or calling it from a LE enabled 
>> "main".
>> 
>> void  main(char * parm)
>> {
>>   Int rc;
>>rc = Asmfunc();
>> }
>> 
>> -Original Message-
>> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] 
>> On Behalf Of Joseph Reichman
>> Sent: Wednesday, July 3, 2019 2:51 PM
>> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
>> Subject: Re: C DLL Code from Assembler
>> 
>> *** External email: Verify sender before opening attachments or links ***
>> 
>> 
>> I saw reference to DLL's in the XL C bookshelf
>> 
>> Unlike Windows there doesn't seem to be a DLLMAIN function
>> 
>> Thanks
>> 
>> 
>> 
>> 
 On Jul 3, 2019, at 3:46 PM, Tony Harminc  wrote:
 
 On Tue, 2 Jul 2019 at 17:24, Joseph Reichman  wrote:
 
 I am hoping to have the Assembler Started task code call a C DLL,  On
 the Windows end it would be C/C+ code calling the DLL obviously there
 are differences because of the platform but I am guessing hose call
 be handled by #IFDEF
 
 In Windows Loading the DLL is a LoadLibrary Api then GetProcAddress
 to get the exports
 
 I am not sure how to do this in Assembler is there a LoadLibrary
 Macro or a GetProcAddress macro to call the exported function
>>> 
>>> DLLs are discussed in the LE book _Language Environment Programming
>>> Guide_ in Chapter 4. Most of the examples and discussions are about C,
>>> but there are some brief assembler bits. And there is a discussion of
>>> assembler considerations (not just for DLLs) in Chapter 29, including
>>> the various macros you need.
>>> 
>>> To be clear, HLASM *is* explictly a supported language for both
>>> writing and invoking DLLs under LE. See "Support for DLLs" at the very
>>> start of Chapter 4.
>>> 
>>> I haven't played with this for many years, and am not current, but
>>> other people on this list have written about it - maybe John McKown?
>>> And there was the Trainer's Friend guy (Steve Comstock?), who gave
>>> courses on this and related LE matters. He made his course materials
>>> available for sale when he closed the business. Maybe they are still
>>> out there? Ah - I see some of it is now on Amazon. Not free, but maybe
>>> a good deal.
>>> http://TOC.ASG.COM:8080/?dmVyPTEuMDAxJiY1NDU1NmVlYzI3Nzk4NzhlZT01RDFEMDcxOV85OTE1N185NjNfMSYmNTBjMjY5NGQ5NGMxYTRlPTEyMzImJnVybD1odHRwJTNBJTJGJTJGd3d3JTJFdHJhaW5lcnNmcmllbmQlMkVjb20lMkZ6T1MlMkVzaHRtbA==
>>>  I have no connection, etc...
>>> 
>>> Tony H.