[Coco] OS-9 question: Command line arguments?
robert.gault at worldnet.att.net
Tue May 20 23:24:14 EDT 2008
Fedor Steeman wrote:
> Thanks, Gene!
> Cool! Sure the handling of arguments is up to the program, but here I am
> wondering how exactly they are passed? Does OS-9 store arguments on a
> standard location in memory for programs to access? Or is there a pointer
> stored in one of the registers? Or does the program itself figure out where
> the command line prompt is and read the arguments directly from video
To add to what Gene has said, in OS-9 when you enter the name of a
command to run, Shell takes over. "When the shell processes a command
line, It passes a string in the parameter area. The string is a copy of
the parameter part of the command line. To simplify string oriented
processing, the shell also inserts an end-of-line character at the end
of the parameter string."
The above is from the Technical section of the OS-9 LevelII owner's
manual describing the OS-9 system call Fork. The system sets up memory
after a F$Fork call so that regU and regDP point to the beginning of the
direct page. The data and then parameter areas follow with regX and
regSP pointing to the first byte of the parameter area, regY pointing to
the end of the parameter area, and regD the size of the parameter area.
More information about the Coco