X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_divmod.adoc;h=432e37926f3ce572a935dc8986f71d155a06d6fd;hb=2c1ddb0d590be01213e6aab07bc5d073b0d3c567;hp=bae6cbb0ef3fbfcea4324228057e743950004920;hpb=b7da3f7bbd1cb10241163abdb950472e539e796d;p=rrq%2Frrqforth.git diff --git a/adoc/p_divmod.adoc b/adoc/p_divmod.adoc index bae6cbb..432e379 100644 --- a/adoc/p_divmod.adoc +++ b/adoc/p_divmod.adoc @@ -1,9 +1,21 @@ +// math.asm: WORD p_divmod,'/MOD',fasm + anchor:p_divmod[] -Word: /MOD ----------- +=== Word: /MOD + +.... +Data stack: ( v1 v2 -- q r ) +.... + +"/MOD" (div-mod) is a function word that replaces a pair of values +with the results of signed integer division of the first, v1, divided +by the second, v2. To that end, the values are 64-bit signed integers. +The result is the integer quotient, q, and the remainder, r, where q +and r are the respectively largest and smallest integers to satisfy +the formula: +.... + v1 = q * v2 + r +.... ----- -math.asm: WORD p_divmod,'/MOD',fasm -----