Thread View: alt.msdos.programmer
2 messages
2 total messages
Started by Mats Fraennhagen
Wed, 11 Nov 1992 09:32
detecting parameters
Author: Mats Fraennhagen
Date: Wed, 11 Nov 1992 09:32
Date: Wed, 11 Nov 1992 09:32
11 lines
672 bytes
672 bytes
I've written a small program in assembler and I would like to detect if any parameters like: test -? is given after the filename. Does DOS support this? /Mats -- Mats Fraennhagen Email: d91mf@efd.lth.se
Re: detecting parameters
Author: Duane A. Paulson
Date: Wed, 11 Nov 1992 17:51
Date: Wed, 11 Nov 1992 17:51
29 lines
1474 bytes
1474 bytes
In a previous article, d91mf@efd.lth.se (Mats Fraennhagen) says: >I've written a small program in assembler and I would like to >detect if any parameters like: > >test -? > > is given after the filename. Does DOS support this? > > /Mats > >-- > Mats Fraennhagen Email: d91mf@efd.lth.se > Sure does. This info is in the Program Segment Prefix (PSP), which dos loads as the first 256 bytes of any program. Register ES always points to the beginning of the PSP at the start of a program, no matter whether the program is .COM or .EXE. The start of the command tail (everything following the program name) is at offset 81hex within the PSP. It ends with a CR. A count of the characters in the command tail, including the terminating CR, can be found at offset 80hex within the PSP. Have fun! (C overhead isn't that much!) -- Duane Paulson ci922@cleveland.freenet.edu duane.paulson@pcb.batpad.lgb.ca.us
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads