X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_args.adoc;h=825ca358b3ecd12c0d62da8e696ffd5c9b6d9dee;hb=bf67023324b2a0c5723dd3167ef757209ba62e01;hp=a003e7af438f67f2519975b67158213463046936;hpb=f38c72b71edee9d23d958a1af73f843b5d44ccbe;p=rrq%2Frrqforth.git diff --git a/adoc/p_args.adoc b/adoc/p_args.adoc index a003e7a..825ca35 100644 --- a/adoc/p_args.adoc +++ b/adoc/p_args.adoc @@ -1,15 +1,25 @@ -//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. +==== +.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: first argument string + 8* ... + 8 zero +---- +====