Ver código fonte

docs: record the start of the MBF stage

CALC-COMPILE.md: the baseline is the run just made (83/83 compile, 72/72
executed, runtime 964 bytes, rt_exec 69/69, non-vacuity 108/108), and item
17 now records the MBF plan in order: real_from_int done; readd/resub,
remult, rediv, recmp, reint, fmtreal/ascreal next; then the compiler-side
real value model, comparisons and function results.

SUMMARY.md: the next-rung sentence notes that the MBF core has started.
Eric Streit 1 dia atrás
pai
commit
db18c64e22
2 arquivos alterados com 22 adições e 13 exclusões
  1. 20 12
      CALC-COMPILE.md
  2. 2 1
      SUMMARY.md

+ 20 - 12
CALC-COMPILE.md

@@ -446,8 +446,8 @@ Exec86):
 | `0946e80` | `v-TP3-CALC-REALCONST` | `ERR 41 15911` (`Upcase`) |
 | `17f7f7c` | `v-TP3-CALC-UPCASE` | **`ERR 102 18267`** (real output) |
 
-- **Code HEAD** `17f7f7c` (`v-TP3-CALC-UPCASE`); this commit only updates
-  this document.  Nothing pushed; `origin/master` is behind by nineteen code
+- **Code HEAD** `05f118f` (`v-TP3-MBF-FROMINT`); this commit only updates
+  this document.  Nothing pushed; `origin/master` is behind by twenty code
   commits.  Two non-ladder commits in the same period are the terminal-config
   work (`v-TP3-TERMCFG`) and the editor key map (`v-TP3-EDITORKEYS`); they do
   not move the ladder and are documented in `TERMINAL.md`.
@@ -552,9 +552,10 @@ Exec86):
   **OVERALL: ALL PASS**, compile matrix **83/83**, CALC ladder **1/1** at
   `ERR 102 18267`, terminal config **4/4**, 64 `.COM` linked and **72 executed
   under both qemu and Exec86** (`t64_arrays` is compile-only: its image is past
-  the 8 KB boot-sector read).  `tests/nonvacuity.sh`: **107 ok, 0 failed**.
-  The runtime is 878 bytes (wrintw added; the golden was re-blessed).
-  `tests/check_realconst.py` pins the measured 6-byte Real operand bytes.
+  the 8 KB boot-sector read).  `tests/nonvacuity.sh`: **108 ok, 0 failed**.
+  The runtime is 964 bytes (wrintw and real_from_int; the golden was
+  re-blessed) and `tests/rt_exec.py` passes **69/69**.  `check_realconst.py`
+  pins the measured 6-byte Real operand bytes.
 - **`tests/nonvacuity.sh`:** re-run after this commit's cases (the set
   membership bit among them); see the commit message for the count. It is not in
   the default `run_all.sh` and must be run **manually** after touching any check.
@@ -667,13 +668,20 @@ Then the two that are *outside* the ladder and gate the goal as stated:
     against literals, typed constants and data sets; a string field is
     readable/writable through DI; Exec86 gained D0-D3.
 
-17. **REAL output and arithmetic — THE NEXT RUNG (18267).**  `Write(Value:
-    FW:DEC)` needs the 6-byte MBF value formatted with a width and decimals,
-    and CALC's evaluator (`Expression`/`Factor`/`Term`, `Sqrt`, `Sqr`, `Sin`,
-    `Cos`, `Arctan`, `Ln`, `Exp`, `Str`, `Val`) needs real arithmetic and
-    function results.  This is item 7's stage and is a design step, not a
-    one-rung change: decide the arithmetic core (runtime routines over MBF vs
-    a wider internal form) and the formatting algorithm before emitting code.
+17. **REAL arithmetic, IN PROGRESS — THE NEXT RUNG is still 18267.**
+    The core is being ported from TPSRC2/3's own MBF library (the measured
+    6-byte format in CALC-PORT.md), not re-invented:
+      * **DONE: `real_from_int`** (`v-TP3-MBF-FROMINT`, entry 21).  ABI:
+        source address at [BP+6], destination at [BP+4]; TPSRC3 `intreal` in
+        AL/AH/BX/DX.  13 rt_exec cases against the measured table.
+      * **NEXT:** `readd`/`resub` (the same AX/BX/DX + CX/SI/DI convention),
+        `remult`, `rediv`, `recmp`, `reint`, then `fmtreal`/`ascreal` for
+        `Write(Value:FW:DEC)`, `Str` and `Val`.  Each is a direct
+        transcription with rt_exec cases; the register convention is the
+        reference's, so the arithmetic can be checked byte for byte.
+      * **THEN** the compiler side: real expressions need a value model
+        (pointers to 6-byte temporaries), real comparisons, and real function
+        results (currently refused because the result is wider than a word).
 
 14. **Raise the execution harness's read.**  `tests/exec/bootcom.s` reads 16
     sectors (8192 bytes); `t64_arrays` is already compile-only for that reason,

+ 2 - 1
SUMMARY.md

@@ -2052,7 +2052,8 @@ run-time `in` (`t78_setfield`), string fields through DI (`t79_strfield`),
 the measured 6-byte REAL constants (`t80_realconst`, with a byte-level check),
 `UpCase` and run-time set membership (`t81_upcase`, `t82_setin`), and
 `INT 10h`+`C6`+`D0-D3` in Exec86 (fixtures through `t82_setin`). The next rung
-is REAL output/arithmetic; then the remaining string
+is REAL output/arithmetic (the MBF core has started: `real_from_int`, entry
+21, is in the runtime and checked by 13 rt_exec cases); then the remaining string
 builtins, file operations, variable-index subscripts + `with`, pointers, `var`
 params, reals, recursion, and the layout change. Items 1-4 below are
 independent of both.