Explorar o código

feat(express): proc47 near-exact (heapLR staging, LONGREAL conventions)

Eric Streit hai 2 semanas
pai
achega
f869b90586
Modificáronse 2 ficheiros con 17 adicións e 0 borrados
  1. 4 0
      SESSION.md
  2. 13 0
      src/compiler/EXPRESS.MOD

+ 4 - 0
SESSION.md

@@ -328,3 +328,7 @@ Next: GENZ80 media hunt; stage-2 pty-driven MCD diff per module.
   VAR-address elided (T7); tmp.a: LPtr heap LONGREAL temp; CARDINAL truthiness
   banned in IF (unlike orjp) -> BOOLEAN param; -2147483647L-1L folds to MINLONG
   imm (no delta). ResetFrame wipes tail junk (balance panic unfounded).
+- proc47 near-exact (2-op FIXME-STORE only): transfer-deref-assign
+  syntax-banned even parenthesized; heapLR staging global appended at word10
+  (no shifts). LONGREAL params: caller pushes quad, callee leave-132
+  (drop-4+restore); ll=absolute frame-quad, ss=indirect (spec verified).

+ 13 - 0
src/compiler/EXPRESS.MOD

@@ -83,6 +83,7 @@ FROM SYSTEM IMPORT ADR, MOVE; (* ADDRESS/WORD/RecordPtr come via DEF imports (le
        | FALSE: lh: LONGINT;
        END;
      END;
+     LRPtr = POINTER TO LONGREAL; (* plain longreal pointer (proc47 heap) *)
      WalkPtr = POINTER TO Walk; (* self-closed walk view: every link field
        reassigns the cursor slot; w2 unwraps to RecordPtr via free transfer
        for ConstToCard; w7 exists (unlike 7-word records) *)
@@ -100,6 +101,7 @@ VAR
     spare7: CARDINAL;     (* word7: use TBD *)
     assignActive: CARDINAL; (* word8 *)
     exprPool: ADDRESS;    (* word9 *)
+    heapLR: LRPtr;        (* word10, appended: proc47 staging (no shifts) *)
 
 (* ---- unresolved EXPRESS-internal helpers: FORWARD = work list ---- *)
 (* Forward refs to group-defined procedures used before definition *)
@@ -252,6 +254,17 @@ BEGIN HALT; END OpSetTest;
    below is a different, emit-only proc). *)
 PROCEDURE ParseActualList;
 BEGIN HALT; END ParseActualList;
+(* proc47 @0eb9 — spill LONGREAL arg to heap, point curDesc at it.
+   FIXME-STORE: MCD stores the quad directly to heap via the value field
+   (`LRPtr(curDesc^.value)^ := lr`), but transfer-deref-assign is a retail
+   syntax ban (even parenthesized). Retail-legal staging through appended
+   heapLR (2 extra ops); heapLR appended LAST so no global slot shifts. *)
+PROCEDURE Proc47(lr: LONGREAL);
+BEGIN
+  Scanner.Allocate(curDesc^.value, 8);
+  heapLR := LRPtr(curDesc^.value);
+  heapLR^ := lr;
+END Proc47;
 (* proc29 @01eb — trap emitter called after stdproc-mismatch (error 67) from
    ParseFactor/ParseAssignment. Reads packed bytes of curNode field 5.
    FIXME-BYTE: MCD reads them via LoadAddr+indexed-byte (&(field)+index),