MCOrder.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Created by: Sindhu, June 20, 1985 7:04:53 pm PDT
Last Edited by: Sindhu, July 7, 1985 1:48:03 am PDT
DIRECTORY
AlpsBool, MCCtl;
MCOrder: CEDAR PROGRAM
IMPORTS AlpsBool, MCCtl
EXPORTS MCCtl =
BEGIN OPEN AlpsBool, MCCtl;
Order: PUBLIC PROC [table: TableOfVariables] =
BEGIN
order: ARRAY [0..2] OF Expression; -- the outputs; note they are not latched
mcmd10, mcmd12, other: Expression;
mcmd10 ← EqualInt[table, "MCmdxBA", 0, 3, 10];
mcmd12 ← EqualInt[table, "MCmdxBA", 0, 3, 12];
other ← Not[Or[table, mcmd10, mcmd12]];
Define the outputs and then add them to table
order[0] ← Or[table,
And[table, mcmd10, Find[table, "arrayMatchxAB"], Not[Find[table, "wtProtectFlag"]]],
And[table, mcmd12, Find[table, "arrayMatchxAB"], Not[Find[table, "wtProtectFlag"]]],
And[table, mcmd12, Find[table, "arrayMatchxAB"], Find[table, "wtProtectFlag"]],
other];
order[1] ← Or[table,
And[table, mcmd10, Find[table, "arrayMatchxAB"], Find[table, "wtProtectFlag"]],
And[table, mcmd12, Find[table, "arrayMatchxAB"], Find[table, "wtProtectFlag"]],
other];
order[2] ← Nor[table,
And[table, mcmd10, Find[table, "arrayMatchxAB"], Find[table, "wtProtectFlag"]],
And[table, mcmd12, Find[table, "arrayMatchxAB"], Find[table, "wtProtectFlag"]]];
AddOutput[table, NEW[OutputRec ← [expr: order[0], name: "order[0]"]]];
AddOutput[table, NEW[OutputRec ← [expr: order[1], name: "order[1]"]]];
AddOutput[table, NEW[OutputRec ← [expr: order[2], name: "order[2]"]]];
END;
END.