X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_args.adoc;h=ca3eef6ca2e36cf72089cedf5264c7398433f2d1;hb=1c80c7f2fc08f72bc20d01b12756070b13b230df;hp=7575bd1565d669c5d1e5419c2826909da8647f14;hpb=b7da3f7bbd1cb10241163abdb950472e539e796d;p=rrq%2Frrqforth.git diff --git a/adoc/p_args.adoc b/adoc/p_args.adoc index 7575bd1..ca3eef6 100644 --- a/adoc/p_args.adoc +++ b/adoc/p_args.adoc @@ -1,9 +1,27 @@ -anchor:p_args[] +//rrqforth.asm: WORD p_args,'ARGS',dovalue -Word: ARGS ----------- +anchor:p_args[MAIN-ARGS] +=== Word: MAIN-ARGS + +.... +Data stack: ( -- p[argv** argc] ) +.... + +"ARGS" is a value word that holds a pointer to the command line data +block which consists of a count cell followed by that many asciiz +pointers and then a 0 cell. That is next followed by the environment +as a number of asciiz pointers and a 0 cell. + +==== +.the command line argument block +[caption='Usage example {counter:example}: '] ---- -rrqforth.asm: WORD p_args,'ARGS',dostring +ARGS -> 8 bytes: count of non-zero asciiz pointers following + 8 bytes: command name string + 8* bytes: argument strings + 8 bytes: zero cell + 8* bytes: envirnment strings + 8 bytes: zero cell ---- - +====