|
@@ -30,6 +30,17 @@ work completed since this note:
|
|
|
- absolute variables (`VAR x [addr] : T`) are implemented at module level;
|
|
- absolute variables (`VAR x [addr] : T`) are implemented at module level;
|
|
|
see section 2.1 below.
|
|
see section 2.1 below.
|
|
|
|
|
|
|
|
|
|
+**Progress update 2026-10-28:** suite 332/332; one-shot fixpoint
|
|
|
|
|
+3,671,466 bytes; per-object fixpoint OK (11 objects). Completed:
|
|
|
|
|
+
|
|
|
|
|
+- `SYSTEM.ADDADR`/`SUBADR`/`DIFADR` byte-address builtins;
|
|
|
|
|
+- absolute variables at module and procedure scope, including addresses
|
|
|
|
|
+ above `0x7FFFFFFF` via a 64-bit materialization path;
|
|
|
|
|
+- 4 KiB-class string literals (the practical 255-byte buffer cap is
|
|
|
|
|
+ gone; the scanner, AST and QBE pools all use 4095).
|
|
|
|
|
+- Remaining address work: `MAKEADR`, general `ADDRESS +/-` operators,
|
|
|
|
|
+ range-checked pointer differences and `VOLATILE`.
|
|
|
|
|
+
|
|
|
---
|
|
---
|
|
|
|
|
|
|
|
## 1. `TBITSIZE`
|
|
## 1. `TBITSIZE`
|
|
@@ -76,12 +87,14 @@ V3 currently supports:
|
|
|
- `ADDRESS`/pointer assignment
|
|
- `ADDRESS`/pointer assignment
|
|
|
- `ADDRESS`/pointer equality
|
|
- `ADDRESS`/pointer equality
|
|
|
- `VAL`/`CAST` for compatible scalar representations
|
|
- `VAL`/`CAST` for compatible scalar representations
|
|
|
|
|
+- byte-addressed `ADDADR`/`SUBADR` and `DIFADR` returning `INTEGER`
|
|
|
|
|
|
|
|
V3 does **not** support:
|
|
V3 does **not** support:
|
|
|
|
|
|
|
|
-- `ADDADR`/`SUBADR`/`DIFADR`/`MAKEADR`
|
|
|
|
|
|
|
+- `MAKEADR`
|
|
|
- `ADDRESS + offset`, `ADDRESS - offset`, `ADDRESS - ADDRESS`
|
|
- `ADDRESS + offset`, `ADDRESS - offset`, `ADDRESS - ADDRESS`
|
|
|
- C-style arithmetic on typed `POINTER TO` values
|
|
- C-style arithmetic on typed `POINTER TO` values
|
|
|
|
|
+- range-checked or 64-bit `DIFADR` results
|
|
|
|
|
|
|
|
### Why it is missing
|
|
### Why it is missing
|
|
|
|
|
|
|
@@ -104,7 +117,7 @@ escape hatch.
|
|
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
|
|
-### 2.1 Absolute variables (`VAR x [address] : T`) — implemented 2026-10-27
|
|
|
|
|
|
|
+### 2.1 Absolute variables (`VAR x [address] : T`) — implemented 2026-10-27/28
|
|
|
|
|
|
|
|
GNU Modula-2 supports fixed-address variables:
|
|
GNU Modula-2 supports fixed-address variables:
|
|
|
|
|
|
|
@@ -119,17 +132,17 @@ memory-mapped I/O, firmware tables and embedded targets.
|
|
|
|
|
|
|
|
Current V3 status:
|
|
Current V3 status:
|
|
|
|
|
|
|
|
-- syntax accepted for module-level variables: `VAR v [0x1000] : CARDINAL`;
|
|
|
|
|
|
|
+- syntax accepted for module-level and procedure-local variables:
|
|
|
|
|
+ `VAR v [0x1000] : CARDINAL`;
|
|
|
- addresses are constant-folded; the V3 `0x...` form is required
|
|
- addresses are constant-folded; the V3 `0x...` form is required
|
|
|
(the gm2 `1000H` suffix is not accepted);
|
|
(the gm2 `1000H` suffix is not accepted);
|
|
|
-- `SymTab` records the absolute flag/address;
|
|
|
|
|
|
|
+- `SymTab` records the absolute flag/address; `Lower` copies it into its
|
|
|
|
|
+ own symbol table while the parser scope is still current, so local
|
|
|
|
|
+ absolute variables resolve after parsing;
|
|
|
- `Lower` materializes the fixed address instead of `AddrOf`;
|
|
- `Lower` materializes the fixed address instead of `AddrOf`;
|
|
|
- `QBE` emits no normal data object or initializer for the variable;
|
|
- `QBE` emits no normal data object or initializer for the variable;
|
|
|
- `ADR(v)` returns the fixed address;
|
|
- `ADR(v)` returns the fixed address;
|
|
|
-- absolute variables inside procedures are currently rejected with
|
|
|
|
|
- `not supported yet`;
|
|
|
|
|
-- address materialization currently uses the 32-bit `IntStr` path;
|
|
|
|
|
- addresses above `0x7FFFFFFF` need a long-address follow-up;
|
|
|
|
|
|
|
+- addresses above `0x7FFFFFFF` use `QbeGen.LongIntStr`;
|
|
|
- no `VOLATILE` annotation exists yet, so memory-mapped I/O still needs
|
|
- no `VOLATILE` annotation exists yet, so memory-mapped I/O still needs
|
|
|
careful review.
|
|
careful review.
|
|
|
|
|
|
|
@@ -137,6 +150,8 @@ Covered by:
|
|
|
|
|
|
|
|
```text
|
|
```text
|
|
|
compiler/tests/t_varaddress.mod
|
|
compiler/tests/t_varaddress.mod
|
|
|
|
|
+compiler/tests/t_varaddress64.mod
|
|
|
|
|
+compiler/tests/t_localaddress.mod
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
The test checks `ADR(v) = VAL(ADDRESS, 0x1000)` without dereferencing an
|
|
The test checks `ADR(v) = VAL(ADDRESS, 0x1000)` without dereferencing an
|
|
@@ -2726,8 +2741,8 @@ classes are GObject classes.
|
|
|
## 17. Suggested order of future work
|
|
## 17. Suggested order of future work
|
|
|
|
|
|
|
|
1. `TBITSIZE` (small, standard-facing).
|
|
1. `TBITSIZE` (small, standard-facing).
|
|
|
-2. `ADDADR`/`SUBADR`/`DIFADR` (small, ISO SYSTEM), then absolute
|
|
|
|
|
- variables (`VAR x [const] : T`) as the next address-related gap.
|
|
|
|
|
|
|
+2. ~~`ADDADR`/`SUBADR`/`DIFADR` and absolute variables~~ — done
|
|
|
|
|
+ 2026-10-28 (remaining: `MAKEADR`, `ADDRESS +/-`, `VOLATILE`).
|
|
|
3. Set ordering (bounded gm2 compatibility; fixes `largeset5`).
|
|
3. Set ordering (bounded gm2 compatibility; fixes `largeset5`).
|
|
|
4. Complex types: choose ISO built-ins versus a nonstandard value-record
|
|
4. Complex types: choose ISO built-ins versus a nonstandard value-record
|
|
|
library; remove the misleading `COMPLEX*` aliases.
|
|
library; remove the misleading `COMPLEX*` aliases.
|