dchun@aludra.usc.edu (Dale Chun) (02/10/91)
Can anyone tell me how to get the starting address of the DOS environment? Thanks for any information...! ...dale Dale C. Chun Computer Science University of Southern California dchun@aludra.usc.edu
simpson@aplcen.apl.jhu.edu (Simpson David Grant) (02/10/91)
In article <14822@chaph.usc.edu> dchun@aludra.usc.edu (Dale Chun) writes: > >Can anyone tell me how to get the starting address of the DOS >environment? Thanks for any information...! > This topic is discussed in "PC Magazine DOS Power Tools" (a book I highly recommend) in Chapter 12 (The DOS Environment). The DOS environment is stored in an area of memory called the "Master Environment Block" which is what is accessed by batch files. Each program has its own copy of the master environment block; offset 2Ch in the programs Program Segment Prefix holds a pointer to where this copy of the master environment block is stored. The book gives the following procedure for displaying the contents of the environment. Type: DEBUG to run DOS's DEBUG program. At the hyphen prompt, display the value of the environment pointer by typing: -D 2C 2D This will display a two-byte pointer (such as 0A 55). Display the contents of the environment by typing -D 550A:0 (or whatever the two bytes were that were displayed, remembering to switch the bytes). Again, the book has more info on this. David Simpson