more and better documentation and some reorganisation
[rrq/rrqforth.git] / adoc / p_args.adoc
index 7575bd1565d669c5d1e5419c2826909da8647f14..825ca358b3ecd12c0d62da8e696ffd5c9b6d9dee 100644 (file)
@@ -1,9 +1,25 @@
-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.
+
+====
+.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: first argument string
+       8* ...
+       8 zero
 ----
-
+====