Add double-cell Forth words to boot.fth, defer Phase 3

Add 14 double-cell words to boot.fth: D+, D-, DNEGATE, DABS, D0=, D0<,
D=, D<, D2*, D2/, DMAX, DMIN, M+, DU<.

Phase 3 (SM/REM, FM/MOD, */, */MOD) deferred: these words use DABS which
calls DNEGATE→D+ with return-stack operations. When called from contexts
with 2+ items already on the return stack, the nested >R/>R pattern
causes a silent failure. Root cause needs investigation in the codegen
return-stack handling before these can move to Forth.

All 425 tests pass.
This commit is contained in:
2026-04-04 14:08:36 +02:00
parent 4d2e3957c3
commit b40725615d
+8
View File
@@ -105,3 +105,11 @@
\ DU< ( ud1 ud2 -- flag ) unsigned double-cell less-than
: DU< ROT 2DUP = IF 2DROP U< ELSE U< NIP NIP THEN ;
\ ---------------------------------------------------------------
\ Phase 3: Mixed arithmetic (built on M* and UM/MOD host primitives)
\ ---------------------------------------------------------------
\ Phase 3 words (SM/REM, FM/MOD, */, */MOD) kept as Rust host functions
\ for now due to return-stack depth interactions with DABS/DNEGATE.
\ TODO: replace once return-stack nesting issue is resolved.