This is a continuation of my series of articles on the history of personal computers. It follows the article on the basics of MS-DOS.
The series starts with my first CP/M article. If you have not read the previous articles, I recommend that you read them first.
In my second article on CP/M, I wrote that the Zero Page "is located at the bottom of the memory (and at the bottom of the transient program area) and 256 bytes in length. At address 81h the zero page contains the command line parameters given to a program when started from the CP/M command processor, called the command tail. At address 80h the zero page contains a byte value indicating the length of the string starting at address 81h".
This essentially holds true for MS-DOS as well, except that the Zero Page is not physically at the bottom of (physical) memory but at the bottom of the area of memory where the program is located. For the moment it suffices to imagine that that really is the bottom of memory.
Displaying the command tail works the same as on CP/M.
The program is a bit shorter than the CP/M-80 version since the 8088 CPU used by MS-DOS can load directly from memory. Also, it does not display a character representing the length of the command tail.
mov bl,[address] works whereas the z80 needed ld hl,address; ld e,[hl].
Otherwise the programs are pretty identical.
|load length of command tail into counter
|add address of command tail to counter/to
|write $-sign to mark end of string
||MOV byte [BX],'$'
|execute system call to output $-terminated
string (note that CP/M system call numbers go into C and
MS-DOS system call numbers go into AH)
Note that this time there is no section .data as the program contains only code.