Am Sonntag, dem 19. Nov 2017 schrieb Andreas K. Foerster:

> Am Samstag, dem 18. Nov 2017 schrieb Joe Forster/STA:
> 
> > > By the way, can anybody tell me, how to access environment variables,
> > > when the compiler doesn't support it? (no getenv() and environ=NULL)
> > 
> > Use INT 21h, AH=62h to get the PSP segment and then see the word at offset
> > 002Ch for the segment of environment variables. (See Table 01378 in the Ralf
> > Brown Interrupt List for the PSP structure).

Thanks again.
I have a working implementation of getenv() now. (Not published yet).

Are there any documented limits for environment variables in DOS?

My implementation uses a static buffer. So the content changes with
every call to getenv. This is explicitly allowed by the standard.

I don't want to make the buffer too large though, since space
is so limited in small mode. Currently either the name or the content
may not be larger than 126 characters. If the name is longer, it is
not found. If the content is longer, it is truncated.

Note: bcc doesn't have far pointers.

-- 
AKFoerster <https://AKFoerster.de/>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to