X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_strncmp.adoc;h=54642bd6b9d4e7b05120875d93a831ee33f665d2;hb=92ed95a59cba9c0685150503196877c3d81fedbc;hp=19f2e69e30427d234b948b5d374a7843765fbcfc;hpb=b7da3f7bbd1cb10241163abdb950472e539e796d;p=rrq%2Frrqforth.git diff --git a/adoc/p_strncmp.adoc b/adoc/p_strncmp.adoc index 19f2e69..54642bd 100644 --- a/adoc/p_strncmp.adoc +++ b/adoc/p_strncmp.adoc @@ -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.