command line paramters

Please correct me if i'm wrong on the following:

I understand that if a program is executed with command line arguments after program name then:

1. the program binary code is copied into RAM memory, the loader of the operating system finds a place from memory and puts compiled executable into a free place in memory.
2. The PSP-segment locates before the code segment in the memory and "the loader" calculates some values into the PSP-area. In PSP-segment is put the addresses of segments (DS,SS,CS) the program uses. Also, the PSP segment includes a place where command line arguments are hold, those command line arguments can be referenced by the program. For .com program command line arguments locates somewhere on address with value less of 100H.

If 1 and 2 are correct then my question is:
How many command line parameters can the program take? I suppouse .com program cannot take command line parameters that exeed 64Kb of size...

With "command line parameters" i mean values "arg1" and "arg2":
C:myprog arg1 arg2

Regards,
Charles


Comments

  • : How many command line parameters can the program take? I suppouse .com program cannot take command line parameters that exeed 64Kb of size...
    :
    : With "command line parameters" i mean values "arg1" and "arg2":
    : C:myprog arg1 arg2

    1 and 2 are correct. I don't remember all the little details about the PSP, but you're on target at least.

    The main limitation is DOS's command line length. You can only type ~128 (about 2 lines) characters at the DOS prompt before it forces you to hit enter. That amount of data fits nicely between CS:0 and CS:100.

    -jeff!



  • : : How many command line parameters can the program take? I suppouse .com program cannot take command line parameters that exeed 64Kb of size...
    : :
    : : With "command line parameters" i mean values "arg1" and "arg2":
    : : C:myprog arg1 arg2
    :
    : 1 and 2 are correct. I don't remember all the little details about the PSP, but you're on target at least.
    :
    : The main limitation is DOS's command line length. You can only type ~128 (about 2 lines) characters at the DOS prompt before it forces you to hit enter. That amount of data fits nicely between CS:0 and CS:100.
    :
    : -jeff!
    :
    :
    :
    :
    [green]The command line info starts at offset 0x80 in PSP, for details see http://www.iro.umontreal.ca/~feeley/cours/ift2240/doc/assembly/programsegmentprefix.html[/green]
  • Thank you.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories