On Fri, 4 Apr 2003, Lucius, Leland wrote:

> Hi Paul,
>
> I did something similar.  Except I took C source, compiled it under Linux,
> used TAS to assemble it, and linked it up on OS/390 to produce non-LE based
> zlib and bzip2 libraries.  You can find the libraries in the assembler
> section over at http://www.homerow.net, but here's a snippet from the readme
> that might help you out:
>
> HOW TO USE
>
>     Since GCC was used to build the object, the standard OS linkage
>     conventions are not used.  You will need to pay attention to a
>     few things when using the library.
>
>     First, you HAVE to provide a stack before calling any of the
>     functions.  A 4096 byte stack seems to be sufficient.
>
>     The address of the stack is placed in register R15 and, since the
>     stack is of the top-down variety, the address MUST point to the
>     end of the stack minus the first frame.  Each frame is 96 bytes
>     unless a function requires more than 5 parameters.
>
>     For instance, calling BZ2_bzBuffToBuffCompress() would require you
>     to reserve the standard 96 bytes, plus 8 more since it has 7
>     parameters.  So:
>
>         L        R15,Stkptr             Get address of stack
>         AL       R15,=F'4096'           Point to end of stack
>         SL       R15,=F'104'            Reserve first frame

These last two  seem equivalent to
                        LA                 4096-104(,R15)
and faster (no storage reference) and 12 bytes shorter.

Okay, I'll stop here;-)

--


Cheers
John.

Join the "Linux Support by Small Businesses" list at
http://mail.computerdatasafe.com.au/mailman/listinfo/lssb

Reply via email to