more and better documentation and some reorganisation
[rrq/rrqforth.git] / adoc / p_args.adoc
index a003e7af438f67f2519975b67158213463046936..825ca358b3ecd12c0d62da8e696ffd5c9b6d9dee 100644 (file)
@@ -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
+----
+====