[comp.sys.ibm.pc] Q 1of3 'Assembly & DOS command line'

u-dmfloy%ug.utah.edu@wasatch.utah.edu (Daniel M Floyd) (04/19/89)

In article <4496@tekigm2.MEN.TEK.COM> alanr@tekigm2.MEN.TEK.COM (Alan Rovner) asks:
>Can I access DOS command line arguments through assembly language?

Yes. Look at offset 80h in the PSP (Program Segment Prefix) segment.
For .com programs PSP is the same as the code segment at start up.
For .exe programs PSP is contained in ES and DS registers at start up.
The information there is not gauranteed throughout the program, so
if you want to use it, you've got to save it somewhere when you start up
your program. DOS also has an function call for parsing a command line
but I don't recall right off what it is.


Dan Floyd
8<D=