[comp.sys.atari.st] Lattice C basepage

nowlin@ihuxy.UUCP (06/10/87)

I have a request.  I've modified ASH to pass the environment in the
format that seems to have become the defacto standard for Pexec()ed
programs.  That is the

     var=val\0var=val\0...var=val\0\0

type of (char *) value that some utilities use.  I have now been able write
getenv() functions for Megamax and Alcyon (thanks to some pointers from
Allan Pratt) that access this environment.  I need to be able to do so from
Lattice C as well.  We ported the Icon Programming Language to the ST using
Lattice (needed the 32 bit ints).

I've poked around all over the place below the main() entry point in
Lattice programs and can't locate the basepage.  Megamax and Alcyon give
you an extern _base that's all you need.  Lattice provides no such
variable.  In fact basepage and environment aren't even in the index for
their manual.  Can anyone help me out?  I actually broke down and called
their support phone number, which has now been changed to Bristol England,
and the person answering the phone basically told me to write a letter if I
had any questions.  I'm hoping the net will work faster.

By the way, if anyone wants the getenv() for Megamax and Alcyon send me
mail and I'll mail the source back.  Also, if you want the ASH that passes
the environment as mentioned above mail me.

Jerry Nowlin
(...!ihnp4!ihuxy!nowlin)

schoepf@DMZRZU71.BITNET (06/26/87)

In Digest #250 ihnp4!ihuxy!nowlin@ucbvax.Berkeley.EDU  (Jerry Nowlin) writes:

> I've poked around all over the place below the main() entry point in
> Lattice programs and can't locate the basepage.  Megamax and Alcyon give

Lattice C 3.03 uses an extern _basepage. You find it by looking at the .MAP
file the linker produces if you specify -list on its command line. (this is
the default anyway)
It is referenced in the first few instructions of the STARTUP module,
so you will find it if you look at the very beginning of the code, *NOT*
at the beginning of the main() entry point.
I hope this will solve your problem,

    Rainer Schoepf
   <SCHOEPF@DMZRZU71.BITNET>