Help me please :How to Load text argument from command line to program.

Started by vasant, November 23, 2005, 01:56:33 PM

Previous topic - Next topic

vasant

Like:
a\> Progarm Text


When run Program

: Text


a\> Program Get_txt
: Get_txt


How to Coding?
Thank you.

Gustav


first show us that you have done some efforts on your own, please!


vasant

I want to  create program reproduce Dos 's attrib File .
Like:
A\> attrib +r -r Filename 

But I don' t know Code for get Argument (+r -r Filename)  from commandline.
If no Argument is

A\> attrib

I want is Standardcoding for get Argument to Program.

Like:
Standrad Code for exit to Dos is
mov ah,4ch
int 21h

MichaelW

There is no dedicated DOS service for reading command line arguments. Getting the entire command line is easy. If you are duplicating ATTRIB the most difficult part will probably be extracting and recognizing the individual arguments.

ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H][[drive:][path]filename] [/S]

Some information on the command line is available here:

http://www.masmforum.com/simple/index.php?topic=3149.msg24137#msg24137

The Microsoft documentation refers to the command line arguments as the "command tail". Here is an example in the form of a MASM data definition:

SampleCommandTail db 7, " /c dir", 0Dh

Some programs may require the leading space. The argument delimiters are normally a space or a tab.

If for some reason you cannot get the PSP address by other means, Interrupt 21h functions 51h and 62h will return the segment address of the PSP for the current program.

eschew obfuscation