TamWires.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Alan Bell, August 8, 1987 7:08:22 pm PDT
Last Edited by: Alan Bell August 8, 1987 7:14:21 pm PDT
DIRECTORY Core, CoreCreate, CoreOps, Sisyph;
TamWires: CEDAR PROGRAM
IMPORTS CoreCreate, CoreOps
EXPORTS Tam
= BEGIN
Context:   TYPE = Sisyph.Context;
WIProc:   TYPE = PROC[cx: Context ← NIL] RETURNS[wire: Wire  ← NIL];
Wire: TYPE = Core.Wire;
Wires: TYPE = Core.Wires;
globWire: PUBLIC Wire;
Dual: PUBLIC WIProc = {
a: Core.Wire ← CoreOps.CreateWires[size: 32, name: "perm"];
b: Core.Wire ← CoreCreate.Seq[size: 32, name: "norm"];
FOR bit: NAT IN [0..7] DO
FOR byte: NAT IN [0..3] DO
a[byte+bit*4] ← b[byte*4+bit];
ENDLOOP;
ENDLOOP;
wire ← CoreCreate.Seq[size: 2];
wire[0] ← a;
wire[1] ← b;
globWire ← wire };
END.