<caution>Tooting own horn</caution> If you're really curious and have the time, you might want to look at my contribution to the CBT tape, file #864 from http://cbttape.org/cbtdowns.htm or you can download it directly via:
ftp://cbttape.org/ftp/cbt/CBT864.zip This is a lot of .s files which are complete LE enabled HLASM UNIX command line programs. Comes complete with a makefile. One gotcha is that the source is "free format" and requires that you have the FLOWASM processor available. But the code is readable without it. Well, FSVO "readable", of course. I would _strongly_ suggest that you take the time and effort to LE enable your assembler subroutines if you're going to use them with an LE main routine such as C or COBOL. The debugging from a CEEDUMP is much easier. And this will greatly ease making your code reentrant. Which, again, I strongly suggest for UNIX programs since UNIX defaults to loading the code (TEXT segment) into read-only storage. On Wed, May 1, 2013 at 10:27 AM, Etienne Thijsse <e.thij...@chello.nl>wrote: > Hi all, > > I am trying to call an assembler function from C: > > C-code (bla.c): > > #pragma linkage(BLA,OS) > main() > { > BLA(); > printf("No crash.\n"); > } > > Assembler code (bla1.s): > > BLA CSECT > BLA MODE ANY > > SAVE (14,12) > BALR 3,0 > USING *,3 > ST 13,SAVE+4 <<<<< crashes here > > * todo: add useful code here > > L 15,=X'01' > L 13,SAVE+4 > RETURN (14,12),RC=(15) > > SAVE DS 18F > END > > So the only code in this assembler source is the "standard linkage" stuff, > which I got from the "MVS Assembler Language" book. > > I compiled and linked this under OpenMVS like this: > > cc bla.c bla1.s > > which gives me an executable 'a.out' in the HFS. > > Running this under OpenMVS crashes in the "ST 13,SAVE+4" line, > SC04. If I comment out that line and the corresponding L13,SAVE+4 line, it > does not crash anymore. > I don't understand this... This ST line is part of the standard linkage > 'protocol'; the area where the ST stores is declared in the SAVE DS 18F > line at the bottom --- Why does this crash? > > What is weirder still is that I can copy a.out to a PDSE member, and > submit it with some JCL that has CEE.SCEELIB in its STEPLIB; this does not > crash, without SCEELIB it also crashes. > Adding CEE.SCEELIB to the STEPLIB environment variable in OpenMVS however > does not help, it keeps crashing, SC04. > > Anyone have an idea? > > Thanks, > Etienne > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > -- This is a test of the Emergency Broadcast System. If this had been an actual emergency, do you really think we'd stick around to tell you? Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN