Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!mcvax!ukc!rde From: rde@ukc.UUCP Newsgroups: net.micro.pc Subject: Re: Simple Environment Question Message-ID: <1716@eagle.ukc.ac.uk> Date: Fri, 18-Jul-86 06:12:10 EDT Article-I.D.: eagle.1716 Posted: Fri Jul 18 06:12:10 1986 Date-Received: Mon, 21-Jul-86 05:58:03 EDT References: <10800008@mcomp> <854@ucbcad.BERKELEY.EDU> Reply-To: rde@ukc.ac.uk (R.D.Eager) Organization: U of Kent at Canterbury, Canterbury, UK Lines: 30 In article <854@ucbcad.BERKELEY.EDU> chapman@pavepaws.UUCP (Brent Chapman) writes: >The following information is for DOS 3.x; I am unsure of its applicability >to earlier versions. > >The segment address of a program's copy of the environment is stored at >offset 0x2C in the PSP. It is stored as a series of ASCII strings >(totallyng less than 32K) in the form "NAME=parameter". Each string is >terminated by a byte of zeros. A second byte of zeros follows the last >string in the environment. > >The address of the PSP can be obtained by using interrupt 0x21, function >0x62. Set AH to 0x62, cause an interrupt 0x21, and read the PSP >address from register BX. > All versions of DOS from 2.00 onwards have a way of getting to the PSP. It isn't however the INT 21H call with AH=62H, which appeared later. This generic method (and it *is* documented) is that DS and ES both point to the PSP when the program is entered from DOS.... Hope this helps, -- Bob Eager rde@ukc.UUCP rde@ukc ...!mcvax!ukc!rde Phone: +44 227 66822 ext 7589