[RC5] Re:

gindrup at okway.okstate.edu gindrup at okway.okstate.edu
Thu Jan 29 16:20:24 EST 1998

     First, careful counting of the nomber of characters in the original 
     posting indicates that only 127 characters of the entire command 
     were retained, not just the command tail.
     PC Interrupts (ISBN: 0-201-62485-0) indicates that offset 0x2C of 
     PSP contains the segment of the environment for the process.  The 
     subsequent Table 24-12 indicates that in DOS 3.3 and later, the 
     environment is:
     Null (0x00) terminated sequence of
        Null (0x00) terminated sequence of ASCII characters of the form
     WORD containing the number of subsequent strings (normally 1)
     Sequence (of cardinality just specified) of
        Null (0x00) terminated sequence of ASCII characters.
           The first is the full pathname of the program owning the
           environment; other strings may follow.
     Hope this helps save a trip to the library.
            -- Eric Gindrup ! gindrup at okway.okstate.edu

______________________________ Reply Separator 
Subject: Re: [RC5] Re: 
Author:  <rc5 at llamas.net > at SMTP
Date:    1998/01/29 11:30

'Sanford Olson' said previously:
| .EXE files also have a PSP, but it is not part of the program's CODE 
| segment
This much I knew.  My memory ended there though.  :-)
|  (ok, .EXE's have multiple CODE segments and the PSP is in it's
| own).  Note, the command-tail doesn't include the program path and 
| filename:
Ok.  I've been programming in C under Unix too long.  I wasn't fully 
grokking the idea of a command *tail* versus the whole command line, 
which is what you nominally get in argv[].  (Granted, the DOS libc 
runtimes set up the same (or similar) argv[] as Unix tends to, further 
masking this concept of a command tail from me, the C programmer.)
Where is the full path to the EXE stored?  My foggy memory says that 
around DOS 3.x they started hiding that just behind the environment 
block, but I'm not certain.  I know the 8-character program name is 
stored in part of the header just before the PSP as of DOS 4 or 5.  (Is 
that header the MCB?  Whatever the name is for the chain of "memory 
regions" in the "DOS memory arena" below 1MB....)
If I knew where my copy of "Undocumented DOS" was I'd go look all 
this up.  :-)
|    C:\RC5\RC5DESD.EXE param1 param2 -option1 -option2 
|                       |
|                       + command-tail starts here
Ahh, ok.  It's been awhile.  :-)  So, then, the maximum command length 
is technically "maximum pathname length" + "up to 127 characters of 
Thanks for the clarification.
 +----------- Joseph Zbiciak ----------+
 | - - - -  j-zbiciak1 at ti.com  - - - - |  Join your idle CPU cycles into 
 |- http://www.primenet.com/~im14u2c/ -|  world's largest supercomputer: 
 | - - -Texas Instruments, Dallas- - - |  http://www.distributed.net/ 
 +-----#include <std_disclaimer.h>-----+
To unsubcribe, send 'unsubscribe rc5' to majordomo at lists.distributed.net 
rc5-digest subscribers replace rc5 with rc5-digest

To unsubcribe, send 'unsubscribe rc5' to majordomo at lists.distributed.net
rc5-digest subscribers replace rc5 with rc5-digest

More information about the rc5 mailing list