Correction: you can't use malloc or new to get the area -- they will return 
31-bit storage. You might use __malloc24() which does the obvious. Looking at 
my code, I called out to a GETMAIN LOC=BELOW written in assembler. Can't tell 
you why I did that rather than use __malloc24().

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Charles Mills
Sent: Wednesday, July 14, 2021 9:53 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Mixing C/C++ with LE-conforming IBM HLASM

I played with the approach you suggest and abandoned the effort. Too hard, and 
too likely to break.

What I did do that worked was code a number of atomic assembler routines that 
could be passed a DCB that was kept in an area that I malloc or new in C or 
C++. One of those routines was

    int MAKEDCB(void *DCBarea, const int DCBareaLen, const char *DCBtype, const 
char DDname[8]);

It constructs a DCB in the C/C++ allocated area by moving in a model. DCBtype 
is, e.g., "BPAM". Other routines are, e.g., 

    int OPNDCBIN(void *DCBarea);        // OPEN a DCB for input

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to