Page 1 of 1

Assembler development using Unix System Services

PostPosted: Fri Mar 29, 2013 7:18 am
by mwilliams
Well, I am just curious, has anyone ever compile and linkedit assembler code while using the commands available in the Unix System Services shell (BPXBATCH & OMVS)?

I have been experimenting to some limited success using either of the following commands: c89, cc, & c++.

For example to compile an assembler module (assuming the *.s as the default extension for assembly language.
cc -o printargs.o -c  -W a,list printargs.s


The following link edits the object file: printargs.o
cc – sasm –W l,list –e SASM printargs.o


By default the linkage editor, creates the sasm executable as reentrant
However, while using the parameter –W l,norent is flagged by the linkage editor as ‘NORENT’ as not a valid option. Yet, ‘NORENT’ is valid parameter for the batch (IEWL) binder.

Does anyone has any ideas how to linkedit a non reentrant in USS?

Re: Assembler development using Unix System Services

PostPosted: Sat Apr 06, 2013 6:33 am
by steve-myers
I don't know anything about running the Assembler and Binder in the OMVS environment; I suspect they are attempting to use the Binder SETOPT statement rather than use the equivalent of the PARM parameter. http://publibz.boulder.ibm.com/cgi-bin/ ... 0610105152 appears to state that JCL options like NORENT are not allowed. You would have to use something like SETOPT PARM(REUS(NONE)). I have not tested this; I just spent some time with the manual.

HTH

Re: Assembler development using Unix System Services

PostPosted: Wed Apr 10, 2013 9:56 am
by mwilliams
Thanks, :)
the following option now results in a non reentrant executable:

cc -o sasm -W l,list -W l,REUS=NONE -e SASM printarg.s

As for the OMVS environment, this provides to some degree, the portability of commonly used UNIX tools for development. Although, the actual assembly code is unique per given platform, the use scripts, make tool, etc. can be used as alternatives to the z/OS JCL for program development.

However, though with my limited exposure to UNIX, the following (which were no present in older releases of USS), I believe, are the preferred way of assembling and link-editing programs:

as -o printargs.o --"LIST,OBJ,NODECK,RENT" -a=printargs.lst printargs.s

The above invokes the HLASM assembler, to creates object and compile listing, while supplying the assembler options in quotes.
(Incidentally, I’ve modified the code to be reentrant)

ld -o sasm -b REUS=RENT,PRINT=YES -e SASM printargs.o

The above invokes the Program Management Binder to create an executable.

For further details, see z/OS UNIX System Services Command Reference (z/OS V1R13.0)
http://www-03.ibm.com/systems/z/os/zos/bkserv/r13pdf/#BPX

Re: Assembler development using Unix System Services

PostPosted: Wed Apr 10, 2013 7:21 pm
by dick scherrer
Thanks for posting this!

d