documentation fixes
[rrq/rrqforth.git] / adoc / p_args.adoc
1 //rrqforth.asm: WORD p_args,'ARGS',dovalue
2
3 anchor:p_args[MAIN-ARGS]
4
5 === Word: MAIN-ARGS
6
7 ....
8 Data stack: ( -- p[argv** argc] )
9 ....
10
11 "ARGS" is a value word that holds a pointer to the command line data
12 block which consists of a count cell followed by that many asciiz
13 pointers and then a 0 cell. That is next followed by the environment
14 as a number of asciiz pointers and a 0 cell.
15
16 ====
17 .the command line argument block
18 [caption='Usage example {counter:example}: ']
19 ----
20 ARGS -> 8 bytes: count of non-zero asciiz pointers following
21         8 bytes: command name string
22         8* bytes: argument strings
23         8 bytes: zero cell
24         8* bytes: envirnment strings
25         8 bytes: zero cell
26 ----
27 ====