X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_number.adoc;h=c8759716967d089851d28c9e3c7c55c5ee4a5111;hb=c6fd5bdf3bae68aac49a239548c82a8d08384da8;hp=94d5a3ca7dbe1163ef7b80f7033b9c7090b5c3e1;hpb=b7da3f7bbd1cb10241163abdb950472e539e796d;p=rrq%2Frrqforth.git diff --git a/adoc/p_number.adoc b/adoc/p_number.adoc index 94d5a3c..c875971 100644 --- a/adoc/p_number.adoc +++ b/adoc/p_number.adoc @@ -1,8 +1,20 @@ -Word: NUMBER ----------- +// compile.asm: WORD p_number,'NUMBER',fasm anchor:p_number[] ----- -compile.asm: WORD p_number,'NUMBER',fasm ----- + +=== Word: NUMBER + +.... +Data stack: ( char n -- [ 0 ]/[ v 1 ] ) +.... + +"NUMBER" is a function word that parses a text number using +<> as numerical base, then returns the result number and +a 1 on top, or just a 0 if the word didn't parse. + +A number consists of, first an optional minus sign, if in +<> base, then digits 0-9 and, if in <> +base, letters a-f or A-F for values 10-15. I.e. the normal positive or +negative decimal integers or normal (positive only) hexadecimal +integers.