In <003c01cab362$c950c0c0$5bf242...@org>, on 02/21/2010
   at 06:00 PM, Charles Mills <charl...@mcn.org> said:

>Subject: Best practice for 24-bit storage in assembler called from C/C++

Best practice is for new code to be refreshable and reentrant.

>I'm writing a fairly large MVS batch application in C++. At several
>points it is necessary to call "library" type routines that I am writing
>in assembler. Several of the routines (unfortunately) need to use QSAM
>macros and so need below-the-line storage.

The issues are the same whether the storage is above the line or below.

>Obviously I could do a GETMAIN or STORAGE OBTAIN LOC=24 on the way in
>and FREEMAIN or STORAGE RELEASE on the way out.

Don't you want to leave the DCB open between calls?

>I could make the calling C++ responsible for providing a "work area"
>obtained with _malloc24(). But I don't like that for "aesthetic" reasons
>-
>violates encapsulation, making the caller responsible for the inner
>workings of the called function.

Not if that storage is a "black box".

>Is there a better way?

Does LE use a CXD to allocate a pseudo-register vector?

>Is there some "LE-supported" solution to the whole problem, such as a
>"below the line stack" feature

Unless you're closing the DCB after every call, you want it on the heap
rather than the stack.

--
     Shmuel (Seymour J.) Metz, SysProg and JOAT
     ISO position; see <http://patriot.net/~shmuel/resume/brief.html>
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to