[OpenBIOS] [RFCv2 1/2] Add new defer word for mu/mod to allow division behaviour to be customised on a per platform basis.
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Fri Jan 11 12:38:02 CET 2013
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
openbios-devel/forth/bootstrap/bootstrap.fs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/openbios-devel/forth/bootstrap/bootstrap.fs b/openbios-devel/forth/bootstrap/bootstrap.fs
index 6878449..ded2e90 100644
--- a/openbios-devel/forth/bootstrap/bootstrap.fs
+++ b/openbios-devel/forth/bootstrap/bootstrap.fs
@@ -445,10 +445,15 @@ variable leaves 0 leaves !
\ 7.3.2.3 double number arithmetic
\
+defer (mu/mod)
+
: s>d dup 0 < ;
: dnegate 0 0 2swap d- ;
: dabs dup 0 < if dnegate then ;
-: um/mod mu/mod drop ;
+: um/mod (mu/mod) drop ;
+
+\ default divide implementation
+['] mu/mod ['] (mu/mod) (to)
\ symmetric division
: sm/rem ( d n -- rem quot )
--
1.7.10.4
More information about the OpenBIOS
mailing list