adding the AGAIN control word
[rrq/rrqforth.git] / adoc / p_strncmp.adoc
index 19f2e69e30427d234b948b5d374a7843765fbcfc..54642bd6b9d4e7b05120875d93a831ee33f665d2 100644 (file)
@@ -1,9 +1,18 @@
+// wordlists.asm:      WORD p_strncmp,'STRNCMP',fasm
+
 anchor:p_strncmp[]
 
-Word: STRNCMP
--------------
+=== Word: STRNCMP
+....
+Data stack: ( s1 s2 n -- v )
+....
 
-----
-wordlists.asm: WORD p_strncmp,'STRNCMP',fasm
-----
+"STRNCMP" is a function words that compares up to n characters of
+character sequences s1 and s2, and returns the difference of the first
+differing characters, as in +s2[i] - s1[i]+, or 0 if all n characters
+are the same.
 
+I.e., the value v is less than 0 if string [n:s1] is alpha-numerically
+less than [n:s2],
+v is greater than 0 if [n:s1] is greater than [n:s2],
+and v is 0 if [n:s1] and [n:s2] are equal.