|
@@ -97,7 +97,7 @@ Current rung (measured today, normalised position):
|
|
|
|
|
|
|
|
| position | blocker |
|
|
| position | blocker |
|
|
|
|---|---|
|
|
|---|---|
|
|
|
-| **10350** | `procedure Center(S : AnyString)` — a **string value parameter**, INSIDE `CALC.INC` |
|
|
|
|
|
|
|
+| **10405** | `Length(S)` inside `CALC.INC`'s `Center` — a **string builtin** (`ERR 41`), the first rung that is a standard FUNCTION |
|
|
|
|
|
|
|
|
Rungs behind it (now passed):
|
|
Rungs behind it (now passed):
|
|
|
|
|
|
|
@@ -108,14 +108,15 @@ Rungs behind it (now passed):
|
|
|
| 7972 | `Numbers : set of Char = ['0'..'9']` — set typed constant | sets, increment 1 |
|
|
| 7972 | `Numbers : set of Char = ['0'..'9']` — set typed constant | sets, increment 1 |
|
|
|
| 8098 | `Attributes = (Constant,…)` — enum; and `SetOfAttri = Set of Attributes` | Stage 5 (enums) |
|
|
| 8098 | `Attributes = (Constant,…)` — enum; and `SetOfAttri = Set of Attributes` | Stage 5 (enums) |
|
|
|
| 8362 | `CellRec = record … end` — record type | Stage 7 (record types) |
|
|
| 8362 | `CellRec = record … end` — record type | Stage 7 (record types) |
|
|
|
-| 8705 | `Cells = array['A'..'G',1..FYMax]`, `Sheet : Cells`, `XPOS : array[…] = (…)` | Stage 8 (declarations) |
|
|
|
|
|
-| 9202 | `MCFile : file of CellRec` — the file type, the whole `var` block, and the `{$I}` expansion | Stage 13 (file types) |
|
|
|
|
|
|
|
+| 8705 | `Cells = array['A'..'G',1..FYMax]`, `Sheet : Cells`, `XPOS` | Stage 8 (declarations) |
|
|
|
|
|
+| 9202 | `MCFile : file of CellRec` — file type, whole `var` block, `{$I}` expansion | Stage 13 (file types) |
|
|
|
|
|
+| 10350 | `procedure Center(S : AnyString)` — a **string value parameter** | calling convention, steps 1-3 |
|
|
|
|
|
|
|
|
Rungs ahead:
|
|
Rungs ahead:
|
|
|
|
|
|
|
|
| position | blocker |
|
|
| position | blocker |
|
|
|
|---|---|
|
|
|---|---|
|
|
|
-| 10350 | a string value parameter, then the rest of `CALC.INC`: file operations, indexing, `with`, pointers, `var` params, reals, string builtins, CRT, recursion |
|
|
|
|
|
|
|
+| 10405 | the string builtins (`Length`, `Copy`, `Delete`, `Insert`, `Str`, `Val`), then the rest of `CALC.INC` |
|
|
|
|
|
|
|
|
Corrections the measurements force, worth stating plainly because the stage list
|
|
Corrections the measurements force, worth stating plainly because the stage list
|
|
|
below was written before them:
|
|
below was written before them:
|
|
@@ -159,6 +160,7 @@ stripped.
|
|
|
| array **element** access with a VARIABLE index `Sheet[fx,fy]`, `with` | 13 `with` sites | `ENoLib` — scaled addressing next |
|
|
| array **element** access with a VARIABLE index `Sheet[fx,fy]`, `with` | 13 `with` sites | `ENoLib` — scaled addressing next |
|
|
|
| array indexed by an **enum type** | `CALC.INC:773,927` | `ERR 41` |
|
|
| array indexed by an **enum type** | `CALC.INC:773,927` | `ERR 41` |
|
|
|
| pointers `^Pages`, `New`, `Dispose` | `CALC.INC:579,587,639,690` | `ERR 41` |
|
|
| pointers `^Pages`, `New`, `Dispose` | `CALC.INC:579,587,639,690` | `ERR 41` |
|
|
|
|
|
+| string **value** parameters (`S : AnyString`) | `CALC.INC:17`, … | **done** — whole-slot copy; `t67_strparam` |
|
|
|
| `var` parameters | 10 routines, 14 occurrences (e.g. `CALC.INC:765,979,995,1036`) | **silently by value** |
|
|
| `var` parameters | 10 routines, 14 occurrences (e.g. `CALC.INC:765,979,995,1036`) | **silently by value** |
|
|
|
| self-recursion | `Fact` — `Fact := I * Fact(I - 1)`, `CALC.INC:747,754` | `ERR 1` at the `(` |
|
|
| self-recursion | `Fact` — `Fact := I * Fact(I - 1)`, `CALC.INC:747,754` | `ERR 1` at the `(` |
|
|
|
| mutual recursion via `forward` | `Expression` fwd `CALC.INC:742` ↔ `Factor` calls it at `820`,`932` | `forward` parses; definition untested |
|
|
| mutual recursion via `forward` | `Expression` fwd `CALC.INC:742` ↔ `Factor` calls it at `820`,`932` | `forward` parses; definition untested |
|
|
@@ -455,8 +457,16 @@ Exec86):
|
|
|
**10350**, where the first blocker is a string VALUE parameter in a nested
|
|
**10350**, where the first blocker is a string VALUE parameter in a nested
|
|
|
procedure. File OPERATIONS (`Assign`/`Reset`/…, read/write with a file
|
|
procedure. File OPERATIONS (`Assign`/`Reset`/…, read/write with a file
|
|
|
argument) are the next increment and are loud until then.
|
|
argument) are the next increment and are loud until then.
|
|
|
-- **The ladder now stops at `ERR 102` at `10350`** — `procedure Center(S :
|
|
|
|
|
- AnyString)` in `CALC.INC`, a value parameter wider than a word.
|
|
|
|
|
|
|
+- **String VALUE parameters are landed** (TP3's whole-slot copy). Three
|
|
|
|
|
+ commits: slot sizes (`v-TP3-CALC-PARAMSLOTS`), the parameter list on the proc
|
|
|
|
|
+ symbol (`v-TP3-CALC-PARAMLIST`), and the copy + `size > 2` for strings
|
|
|
|
|
+ (`v-TP3-CALC-STRPARAM`). Fixture `t67_strparam` proves value semantics: the
|
|
|
|
|
+ callee mutates `S[1]`, the caller's string is unchanged. This moved the rung
|
|
|
|
|
+ from 10350 to **10405**.
|
|
|
|
|
+- **The ladder now stops at `ERR 41` at `10405`** — `Length(S)`, inside
|
|
|
|
|
+ `Center`'s body. The string builtins (`Length`, `Copy`, `Delete`, `Insert`,
|
|
|
|
|
+ `Str`, `Val`) are the next increment, and the first rung that is a standard
|
|
|
|
|
+ FUNCTION rather than a type.
|
|
|
- **One surprise on resuming:** the working tree was found holding the
|
|
- **One surprise on resuming:** the working tree was found holding the
|
|
|
nonvacuity script's *frame-rule* mutation of `shell/Compiler.mod` (the
|
|
nonvacuity script's *frame-rule* mutation of `shell/Compiler.mod` (the
|
|
|
`locFree := 0FFFEH` / pre-decrement-base revert), i.e. a mutation from a
|
|
`locFree := 0FFFEH` / pre-decrement-base revert), i.e. a mutation from a
|
|
@@ -466,8 +476,8 @@ Exec86):
|
|
|
byte-for-byte the same for INTEGER locals, so the compile matrix would have
|
|
byte-for-byte the same for INTEGER locals, so the compile matrix would have
|
|
|
been green and only `t40_readln` (and later CALC) would have noticed.
|
|
been green and only `t40_readln` (and later CALC) would have noticed.
|
|
|
- **Verified baseline, run on this commit:** `./tests/run_all.sh` →
|
|
- **Verified baseline, run on this commit:** `./tests/run_all.sh` →
|
|
|
- **OVERALL: ALL PASS**, compile matrix **67/67**, CALC ladder **1/1** at
|
|
|
|
|
- `ERR 102 10350`, 58 `.COM` linked and 56 executed under both qemu and Exec86
|
|
|
|
|
|
|
+ **OVERALL: ALL PASS**, compile matrix **68/68**, CALC ladder **1/1** at
|
|
|
|
|
+ `ERR 41 10405`, 59 `.COM` linked and 57 executed under both qemu and Exec86
|
|
|
(`t64_arrays` is compile-only: its image is past the 8 KB boot-sector read).
|
|
(`t64_arrays` is compile-only: its image is past the 8 KB boot-sector read).
|
|
|
- **`tests/nonvacuity.sh`:** re-run after this commit's cases (the set
|
|
- **`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
|
|
membership bit among them); see the commit message for the count. It is not in
|
|
@@ -510,26 +520,17 @@ ordered by what the ladder will hit next, not by the original stage numbers
|
|
|
shape as this session's nine: one focused change, one fixture that is red before
|
|
shape as this session's nine: one focused change, one fixture that is red before
|
|
|
and green after, an execution proof where the image fits, and a commit.
|
|
and green after, an execution proof where the image fits, and a commit.
|
|
|
|
|
|
|
|
-1. **A string VALUE parameter** — the current rung:
|
|
|
|
|
- `procedure Center(S : AnyString)` (`CALC.INC:17`). `ProcFunc` refuses a
|
|
|
|
|
- parameter wider than a word; a `string[n]` parameter is `n+1` bytes. TP3
|
|
|
|
|
- passes a value parameter's whole size on the stack (`TPSRC7` `tstscal`), so
|
|
|
|
|
- the caller must copy the string into the callee's slot.
|
|
|
|
|
- **Step 1 is DONE** (`v-TP3-CALC-PARAMSLOTS`): parameter *slots* are
|
|
|
|
|
- generalised — `SlotSize (cls, size)` is TP3's "scalar-like ⇒ at least two
|
|
|
|
|
- bytes, larger ⇒ its own size", and the callee's reverse layout is the
|
|
|
|
|
- general `off := 8 + frameTotal − off − slot`, which reduces exactly to the
|
|
|
|
|
- old `parmOff + 2 − off` while every slot is 2. Nothing observable moved
|
|
|
|
|
- (matrix 67/67, ladder unchanged, framedisp PASS, 56/56 executed).
|
|
|
|
|
- **Next:** (3) push a string's whole slot (`SUB SP,size / MOV DI,SP / MOV
|
|
|
|
|
- SI,src / MOV CX,size / CLD / REP MOVSB`, or a `TU_PushStr` entry) and allow
|
|
|
|
|
- `size > 2` for string parameters; (4) a fixture where the callee **mutates**
|
|
|
|
|
- `S` and the caller's variable is unchanged — the value semantics TP3
|
|
|
|
|
- promises. `var` parameters proper are item 6.
|
|
|
|
|
- **Step 2 is DONE too:** the procedure symbol carries `parmFirst`/`parmCount`,
|
|
|
|
|
- `ParmSlot (idx, k)` sizes each argument from it, and `EmCallMost` cleans up
|
|
|
|
|
- the sum of slot sizes. Still behaviour-identical (every slot 2), and a
|
|
|
|
|
- slot > 2 is a loud `ENoLib` until step 3 pushes it.
|
|
|
|
|
|
|
+1. **String VALUE parameters — DONE** (the rung moved 10350 → 10405; the
|
|
|
|
|
+ blocker is now `Length(S)`, a builtin). TP3 puts a value parameter's whole
|
|
|
|
|
+ size on the stack (`TPSRC7` `tstscal`), so a `string[n]` parameter is `n+1`
|
|
|
|
|
+ bytes. The three steps landed as separate commits/tags:
|
|
|
|
|
+ `v-TP3-CALC-PARAMSLOTS` (slot sizes + reverse layout),
|
|
|
|
|
+ `v-TP3-CALC-PARAMLIST` (the procedure symbol carries `parmFirst`/`parmCount`;
|
|
|
|
|
+ call sites size each argument), and `v-TP3-CALC-STRPARAM` (the caller copies
|
|
|
|
|
+ `<len><chars>` into the slot; `EmStrBlob` + `EmPushStrSlot`, a DS-relative
|
|
|
|
|
+ byte loop, no ES dependency). Fixture `t67_strparam`: the callee mutates
|
|
|
|
|
+ `S[1]` and the caller's string is unchanged, so it is a copy and not an
|
|
|
|
|
+ address. `var` parameters proper are item 6.
|
|
|
2. **The rest of the declaration part**, if the rung is still there: local
|
|
2. **The rest of the declaration part**, if the rung is still there: local
|
|
|
`type`/`const`/`var` inside a nested function (`CALC.INC:767-778`, the
|
|
`type`/`const`/`var` inside a nested function (`CALC.INC:767-778`, the
|
|
|
enum-indexed array of strings), `Succ`/`Pred`/`Ord`/`Chr`.
|
|
enum-indexed array of strings), `Succ`/`Pred`/`Ord`/`Chr`.
|