|
|
@@ -1126,12 +1126,12 @@ assertion, rather than asking the compiler where it thinks the header is.
|
|
|
`CmdCompile` honours the Destination option: 0 = memory, 1 = `.COM`, 2 = `.CHN`
|
|
|
(refused). A `.COM` is named after its source with the extension swapped at the
|
|
|
last dot and contains **exactly the runtime and the program's code**; the
|
|
|
-globals are at image `8000h` (memory `8100h`), outside the file, and `initmem`
|
|
|
+globals are at image `0A000h` (memory `0A100h`), outside the file, and `initmem`
|
|
|
zeroes them. Its stack sits at the segment top (`SS = SP = CS:FFFE`), which is
|
|
|
where DOS puts it.
|
|
|
|
|
|
-**Layout:** the old fixed `rtSz + 1000H` data base is gone. `DataStart = 8000h`,
|
|
|
-`CodeMax = 6F00h`, and `MaxCode = 24,000` bound the code image; the `.COM`
|
|
|
+**Layout:** the old fixed `rtSz + 1000H` data base is gone. `DataStart = 0A000h`,
|
|
|
+`CodeMax = 0A000h`, and `MaxCode = 0A000h` bound the code image; the `.COM`
|
|
|
writer emits `ImageBytes()` and no padding. This is the flat-segment equivalent
|
|
|
of the original's separate CS/DS layout (see `CALC-COMPILE.md` §3.2). It is
|
|
|
enough to compile CALC; running CALC with its full 16,384-byte stack and
|
|
|
@@ -1298,9 +1298,9 @@ Details that are deliberate, not incidental:
|
|
|
- **Code above 4 KiB no longer overruns the data area.** The layout rung
|
|
|
(`v-TP3-CALC-LAYOUT`) moved the globals to image `8000h`, made the `.COM`
|
|
|
code-only, and left `initmem` to zero the data. The effective code bound is
|
|
|
- `MaxCode = 24,000` (with `CodeMax = 6F00h` before the boot harness's stdin
|
|
|
- descriptor), not a 4 KiB window. The remaining capacity question is running
|
|
|
- CALC with its original stack and heap, deferred in `CALC-COMPILE.md` §3.2.
|
|
|
+ `MaxCode = 0A000h` (with `CodeMax = 0A000h` before the data base), not a
|
|
|
+ 4 KiB window. The remaining capacity question is running CALC with its
|
|
|
+ original stack and heap, deferred in `CALC-COMPILE.md` §3.2.
|
|
|
- **`[SP]` cannot be encoded on an 8086, and the fix is a shape change.**
|
|
|
`EmMovAxSp`/`EmMovCxSp` now emit `POP reg` / `PUSH reg` — two instructions
|
|
|
where there used to be one, so anything that assumed a one-instruction
|
|
|
@@ -2044,7 +2044,7 @@ the compiler *emitting* a 16,560-byte program). The ratchet and front-end
|
|
|
features through **file control-block operations and the original memory
|
|
|
layout** are landed: the ladder (`tests/calc_ladder.sh` +
|
|
|
`tests/fixtures/calc_ladder.tsv`, run by `run_all.sh`; CALC.PAS now stops at
|
|
|
-`ERR 98` at pos 56540, the code-image ceiling), the `{$I}` include,
|
|
|
+**CALC.PAS compiles** (code 25,908, data 19,694), the `{$I}` include,
|
|
|
`^X`/`#nn`, scalar typed constants, sets, enums, records (CellRec = 80),
|
|
|
subranges, arrays, element/field access, file types, string value parameters,
|
|
|
`Length`, the CRT identifiers (`ClrScr`/`GotoXY`/`ClrEol`/`LowVideo`/
|
|
|
@@ -2070,10 +2070,11 @@ standard functions (`Abs`, `Sqr`, `Sqrt`, `Ln`, `Exp`, `Sin`, `Cos`,
|
|
|
landed, along with `Delete` and local `set of Char` variables. The math runtime
|
|
|
was compacted to guest Horner/square loops, reducing it from 14,063 to 9,203
|
|
|
bytes. `Insert`, CASE/ELSE trailing semicolons and string-vs-CHAR comparisons
|
|
|
-are also landed; the ladder now stops at the code-image ceiling
|
|
|
-(`ERR 98 56540`). The runtime is 9,373 bytes / 56 entries; the rt_exec
|
|
|
-scaffold is at HDR=0x4000 / data 0x5000. Items 1-4 below are independent of
|
|
|
-both tracks.
|
|
|
+are also landed. **CALC.PAS now compiles to its final `.`** with code 25,908
|
|
|
+and data 19,694. The runtime is 9,373 bytes / 56 entries; the rt_exec
|
|
|
+scaffold is at HDR=0x4000 / data 0x5000. The next task is running the larger
|
|
|
+image, not front-end coverage. Items 1-4 below are independent of both
|
|
|
+tracks.
|
|
|
|
|
|
1. The rest of the string language. `v-TP3-STRVAR`/`v-TP3-STRREAD-ASSIGN` cover
|
|
|
string variables, `s := 'literal'`, `writeln (s)`, `readln (s)`/`read (s)`
|