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:
@@ -105,3 +105,11 @@
|
|||||||
|
|
||||||
\ DU< ( ud1 ud2 -- flag ) unsigned double-cell less-than
|
\ DU< ( ud1 ud2 -- flag ) unsigned double-cell less-than
|
||||||
: DU< ROT 2DUP = IF 2DROP U< ELSE U< NIP NIP THEN ;
|
: 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.
|
||||||
|
|||||||
Reference in New Issue
Block a user