|
|
@@ -318,6 +318,63 @@ BEGIN
|
|
|
IF CARDINAL(p^.w2) <> 0 THEN count := CARDINAL(p^.w2^.word3) END;
|
|
|
CodeGen.EmitExtCall3(19, Proc30(p^.w6), (count + 1) DIV 2 * 2);
|
|
|
END Proc31;
|
|
|
+(* proc51 @0ecc — set-constructor collector (NESTED in proc50: move in
|
|
|
+ nesting pass). buf is a Head VALUE local (auto reserve-10; addresses are
|
|
|
+ addresses, so no-^ reads match HeadPtr shapes exactly). *)
|
|
|
+PROCEDURE Proc51(p1: SymTab.T1);
|
|
|
+VAR count: BITSET; (* word-2 *) latch: BOOLEAN; (* word-3 *)
|
|
|
+ flag: BOOLEAN; (* word-4 *) buf: Head; (* word-5, 10 bytes *)
|
|
|
+ lo, hi: CARDINAL; (* word-6, word-7 *)
|
|
|
+BEGIN
|
|
|
+ count := BITSET{}; latch := FALSE;
|
|
|
+ IF NOT Scanner.AcceptSy(7) THEN (* entry negated: body runs when no brace *)
|
|
|
+ REPEAT
|
|
|
+ BoolCondHelper;
|
|
|
+ ConstToCard(RecordPtr(p1^.link2), 0);
|
|
|
+ PopExprDesc(RecordPtr(p1^.link2));
|
|
|
+ IF Scanner.AcceptSy(4) THEN
|
|
|
+ buf := curDesc^;
|
|
|
+ BoolCondHelper;
|
|
|
+ ConstToCard(RecordPtr(p1^.link2), 0);
|
|
|
+ PopExprDesc(RecordPtr(p1^.link2));
|
|
|
+ flag := (curDesc^.mode <> 0) OR (buf.mode <> 0);
|
|
|
+ IF flag THEN CodeGen.EmitStandardOp(26);
|
|
|
+ ELSE
|
|
|
+ CodeGen.DiscardPending; CodeGen.DiscardPending;
|
|
|
+ lo := CARDINAL(buf.value); hi := CARDINAL(curDesc^.value);
|
|
|
+ WHILE lo <= hi DO
|
|
|
+ count := count + BITSET{lo};
|
|
|
+ INC(lo);
|
|
|
+ END;
|
|
|
+ END;
|
|
|
+ ELSE
|
|
|
+ flag := curDesc^.mode <> 0;
|
|
|
+ IF flag THEN CodeGen.EmitStandardOp(5);
|
|
|
+ ELSE
|
|
|
+ CodeGen.DiscardPending;
|
|
|
+ count := count + BITSET{CARDINAL(curDesc^.value)};
|
|
|
+ END;
|
|
|
+ END;
|
|
|
+ IF flag THEN
|
|
|
+ IF latch THEN CodeGen.EmitTypedOp(6, 4) ELSE latch := TRUE END;
|
|
|
+ END;
|
|
|
+ Scanner.TestSet(BITSET{1,7});
|
|
|
+ UNTIL NOT Scanner.AcceptSy(1);
|
|
|
+ Scanner.GetSym;
|
|
|
+ END;
|
|
|
+ IF latch THEN
|
|
|
+ IF count <> BITSET{} THEN
|
|
|
+ CodeGen.QueueConst(CARDINAL(count));
|
|
|
+ CodeGen.EmitTypedOp(6, 4);
|
|
|
+ END;
|
|
|
+ curDesc^.mode := 2;
|
|
|
+ ELSE
|
|
|
+ CodeGen.QueueConst(CARDINAL(count));
|
|
|
+ curDesc^.mode := 0;
|
|
|
+ curDesc^.value := ADDRESS(CARDINAL(count));
|
|
|
+ END;
|
|
|
+ curDesc^.typ := NodePtr(RecordPtr(p1));
|
|
|
+END Proc51;
|
|
|
(* proc28 @009e — ~EmitAddress. *)
|
|
|
PROCEDURE EmitAddress(d: HeadPtr);
|
|
|
VAR k: CARDINAL; (* local-2 *)
|