BitSwOps.mesa
Last edited by: Barth, April 12, 1984 2:19:16 pm PST
Last Edited by: Spreitzer, April 12, 1984 7:59:43 pm PST
DIRECTORY Basics, BitOps, SwitchTypes;
BitSwOps: CEDAR DEFINITIONS =
BEGIN
This is companion interface to BitOps that is used for dealing with MOSSIM style values.
StrengthIndex: TYPE = SwitchTypes.StrengthIndex;
BoolStrengths: TYPE = ARRAY BOOLEAN OF SwitchTypes.Strength;
BoolSwitches: TYPE = ARRAY BOOLEAN OF StrengthenedLevel;
StrengthenedLevel: TYPE = RECORD [strength: SwitchTypes.Strength, level: SwitchTypes.Level];
The containers
BitWord: TYPE = BitOps.BitWord;
BitDWord: TYPE = BitOps.BitDWord;
BitMWord: TYPE = BitOps.BitMWord;
Switch: TYPE = SwitchTypes.SwitchVal;
SwitchMWord: TYPE = LONG DESCRIPTOR FOR PACKED ARRAY CARDINAL OF Switch;
The externals
BOOL and CARDINAL already exist!
Long: TYPE = BitOps.Long;
Extraction and Insertion procedures
Bools
ExtractBoolFSwitch, EBFS: PROC [container: SwitchMWord, containerWidth, bitPosition: CARDINAL] RETURNS [result: BOOL];
InsertBoolInSwitch, IBIS: PROC [source: BOOL, container: SwitchMWord, containerWidth, bitPosition: CARDINAL, si: StrengthIndex, how: BoolStrengths];
SpecialInsertBoolInSwitch, SIBIS: PROC [source: BOOL, container: SwitchMWord, containerWidth, bitPosition: CARDINAL, how: BoolSwitches];
ExtractBoolFSingleSwitch, EBFSS: PROC [container: Switch] RETURNS [result: BOOL];
InsertBoolInSingleSwitch, IBISS: PROC [source: BOOL, container: Switch, si: StrengthIndex, how: BoolStrengths] RETURNS [newContainer: Switch];
SpecialInsertBoolInSingleSwitch, SIBISS: PROC [source: BOOL, container: Switch, how: BoolSwitches] RETURNS [newContainer: Switch];
Cardinals
ExtractCardinalFSwitch, ECFS: PROC [container: SwitchMWord, containerWidth, fieldPosition, fieldWidth: CARDINAL] RETURNS [result: CARDINAL];
InsertCardinalInSwitch, ICIS: PROC [source: CARDINAL, container: SwitchMWord, containerWidth, fieldPosition, fieldWidth: CARDINAL, si: StrengthIndex, how: BoolStrengths];
SpecialInsertCardinalInSwitch, SICIS: PROC [source: CARDINAL, container: SwitchMWord, containerWidth, fieldPosition, fieldWidth: CARDINAL, how: BoolSwitches];
ExtractCardinalFSingleSwitch, ECFSS: PROC [container: Switch] RETURNS [result: [0..1]];
InsertCardinalInSingleSwitch, ICISS: PROC [source: [0..1], container: Switch, si: StrengthIndex, how: BoolStrengths] RETURNS [newContainer: Switch];
SpecialInsertCardinalInSingleSwitch, SICISS: PROC [source: [0..1], container: Switch, how: BoolSwitches] RETURNS [newContainer: Switch];
Longs
ExtractLongFSwitch, ELFS: PROC [container: SwitchMWord, containerWidth, fieldPosition, fieldWidth: CARDINAL] RETURNS [result: Long];
InsertLongInSwitch, ILIS: PROC [source: Long, container: SwitchMWord, containerWidth, fieldPosition, fieldWidth: CARDINAL, si: StrengthIndex, how: BoolStrengths];
SpecialInsertLongInSwitch, SILIS: PROC [source: Long, container: SwitchMWord, containerWidth, fieldPosition, fieldWidth: CARDINAL, how: BoolSwitches];
Moving bit fields
Word as source
ConvertWordToSwitch, CWTS: PROC [sourceContainer: BitWord, sourceContainerWidth, sourcePosition, sourceWidth: CARDINAL, destinationContainer: SwitchMWord, destinationContainerWidth, destinationPosition, destinationWidth: CARDINAL, si: StrengthIndex, how: BoolStrengths];
SpecialConvertWordToSwitch, SCWTS: PROC [sourceContainer: BitWord, sourceContainerWidth, sourcePosition, sourceWidth: CARDINAL, destinationContainer: SwitchMWord, destinationContainerWidth, destinationPosition, destinationWidth: CARDINAL, how: BoolSwitches];
Double as source
ConvertDoubleToSwitch, CDTS: PROC [sourceContainer: BitDWord, sourceContainerWidth, sourcePosition, sourceWidth: CARDINAL, destinationContainer: SwitchMWord, destinationContainerWidth, destinationPosition, destinationWidth: CARDINAL, si: StrengthIndex, how: BoolStrengths];
SpecialConvertDoubleToSwitch, SCDTS: PROC [sourceContainer: BitDWord, sourceContainerWidth, sourcePosition, sourceWidth: CARDINAL, destinationContainer: SwitchMWord, destinationContainerWidth, destinationPosition, destinationWidth: CARDINAL, how: BoolSwitches];
Multiple as source
ConvertMultipleToSwitch, CMTS: PROC [sourceContainer: BitMWord, sourceContainerWidth, sourcePosition, sourceWidth: CARDINAL, destinationContainer: SwitchMWord, destinationContainerWidth, destinationPosition, destinationWidth: CARDINAL, si: StrengthIndex, how: BoolStrengths];
SpecialConvertMultipleToSwitch, SCMTS: PROC [sourceContainer: BitMWord, sourceContainerWidth, sourcePosition, sourceWidth: CARDINAL, destinationContainer: SwitchMWord, destinationContainerWidth, destinationPosition, destinationWidth: CARDINAL, how: BoolSwitches];
Switch as source
ConvertSwitchToWord, CSTW: PROC [sourceContainer: SwitchMWord, sourceContainerWidth, sourcePosition, sourceWidth: CARDINAL, destinationContainer: BitWord, destinationContainerWidth, destinationPosition, destinationWidth: CARDINAL] RETURNS [newContainer: BitWord];
ConvertSwitchToDouble, CSTD: PROC [sourceContainer: SwitchMWord, sourceContainerWidth, sourcePosition, sourceWidth: CARDINAL, destinationContainer: BitDWord, destinationContainerWidth, destinationPosition, destinationWidth: CARDINAL] RETURNS [newContainer: BitDWord];
ConvertSwitchToMultiple, CSTM: PROC [sourceContainer: SwitchMWord, sourceContainerWidth, sourcePosition, sourceWidth: CARDINAL, destinationContainer: BitMWord, destinationContainerWidth, destinationPosition, destinationWidth: CARDINAL];
MoveSwitchToSwitch, MSTS: PROC [sourceContainer: SwitchMWord, sourceContainerWidth, sourcePosition, sourceWidth: CARDINAL, destinationContainer: SwitchMWord, destinationContainerWidth, destinationPosition, destinationWidth: CARDINAL];
END.