ExecutionUnits:
PUBLIC PROC [euControl: SevenBitIndex, d1, d2: Word]
RETURNS
[result: Word, overFlow, carry, gt: BOOL] ~ {
selectedUnit: ThreeBitIndex ← LOOPHOLE[euControl, NAT]/16;
euOp: FourBitIndex ← euControl MOD 16;
Do the adder all of the time to set up the condition bits
[result, overFlow, carry, gt] ← Adder[euOp, d1, d2];
SELECT
LOOPHOLE[selectedUnit, EuUnits]
FROM
NOP => NULL;
Adder => NULL; -- Have already done it
LU => result ← LogicalUnit[euOp, d1, d2];
Shifter => result ← Shifter[d1, d2, 4];
Prior => result ← PriorityEncoder[d1];
ENDCASE => SIGNAL UnitNotImplemented[euOp];
RETURN [result, overFlow, carry, gt];