X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_args.adoc;h=ca3eef6ca2e36cf72089cedf5264c7398433f2d1;hb=39427aee877cab09feea798b146e06dc7bfc25cc;hp=a003e7af438f67f2519975b67158213463046936;hpb=656f37efbd89db1b1088281047a9633cf74e92ec;p=rrq%2Frrqforth.git diff --git a/adoc/p_args.adoc b/adoc/p_args.adoc index a003e7a..ca3eef6 100644 --- a/adoc/p_args.adoc +++ b/adoc/p_args.adoc @@ -1,15 +1,27 @@ -//rrqforth.asm: WORD p_args,'ARGS',dostring +//rrqforth.asm: WORD p_args,'ARGS',dovalue -anchor:p_args[] +anchor:p_args[MAIN-ARGS] -=== Word: ARGS +=== Word: MAIN-ARGS .... -Data stack: ( -- argv** argc ) +Data stack: ( -- p[argv** argc] ) .... -"ARGS" is a value word that results in pusing the command line -argument block. Here argc is the length of the block, and argv** is a -pointer to a data block of that many asciiz pointers, which are the -command line arguments given to RRQFORTH at start. +"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}: '] +---- +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 +---- +====