Command-line arguments: Difference between revisions

m
no edit summary
mNo edit summary
Line 89:
</pre>
 
=={{header|8086 Assembly}}==
The method for doing this depends on the memory model of your program. For a COM file, everything is contained in one segment, including the command line arguments. The program starts at offset 100h and the command line arguments start at 81h. It's as simple as reading from that memory address.
 
For an EXE file, both the <code>DS</code> and <code>ES</code> registers are set to the program segment prefix as soon as the program begins. You'll need to load from offset 81h to FFh to get the command line arguments.
 
 
1,489

edits