forth: pictured numeric output <#/#/#S/#>/HOLD/SIGN + U./U.R/.R (Hayes 448/638, 70%)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-04-25 00:23:04 +00:00
parent c726a9e0fe
commit 47f66ad1be
5 changed files with 254 additions and 11 deletions

View File

@@ -89,7 +89,7 @@ Representation:
- [x] Unsigned compare: `U<`, `U>`
- [x] Mixed/double-cell math: `S>D`, `M*`, `UM*`, `UM/MOD`, `FM/MOD`, `SM/REM`, `*/`, `*/MOD`
- [x] Double-cell ops: `D+`, `D-`, `D=`, `D<`, `D0=`, `2DUP`, `2DROP`, `2OVER`, `2SWAP` (already), plus `D>S`, `DABS`, `DNEGATE`
- [ ] Number formatting: `<#`, `#`, `#S`, `#>`, `HOLD`, `SIGN`, `.R`, `U.`, `U.R`
- [x] Number formatting: `<#`, `#`, `#S`, `#>`, `HOLD`, `SIGN`, `.R`, `U.`, `U.R`
- [ ] Parsing/dictionary: `WORD`, `FIND`, `EXECUTE`, `'`, `[']`, `LITERAL`, `POSTPONE`, `>BODY`, `DOES>`
- [ ] Source/state: `SOURCE`, `>IN`, `EVALUATE`, `STATE`, `[`, `]`
- [ ] Misc Core: `WITHIN`, `MAX`/`MIN` (already), `ABORT`, `ABORT"`, `EXIT`, `UNLOOP`
@@ -106,6 +106,16 @@ Representation:
_Newest first._
- **Phase 5 — pictured numeric output: `<#`/`#`/`#S`/`#>`/`HOLD`/`SIGN` +
`U.`/`U.R`/`.R` (+9; Hayes 446→448, 70%).** Added a `state.hold`
list of single-character strings — `<#` resets it, `HOLD` and
`SIGN` prepend, `#` divides ud by BASE and prepends one digit,
`#S` loops `#` until ud is zero (running once even on zero),
`#>` drops ud and copies the joined hold buffer into mem,
pushing `(addr, len)`. `U.` / `.R` / `U.R` use a separate
`forth-num-to-string` for one-shot decimal/hex output and
`forth-spaces-str` for right-justify padding.
- **Phase 5 — double-cell ops `D+`/`D-`/`DNEGATE`/`DABS`/`D=`/`D<`/`D0=`/
`D0<`/`DMAX`/`DMIN` (+18; Hayes unchanged).** Doubles get rebuilt
from `(lo, hi)` cells via `forth-double-from-cells-s`, the op runs