DIRECTORY Basics, BitOps, RoseBehavior; BitSwOps: CEDAR DEFINITIONS = BEGIN StrengthIndex: TYPE = RoseBehavior.StrengthIndex; BoolStrengths: TYPE = ARRAY BOOLEAN OF RoseBehavior.Strength; BoolSwitches: TYPE = ARRAY BOOLEAN OF StrengthenedLevel; StrengthenedLevel: TYPE = RECORD [strength: RoseBehavior.Strength, level: RoseBehavior.Level]; BitWord: TYPE = BitOps.BitWord; BitDWord: TYPE = BitOps.BitDWord; BitMWord: TYPE = BitOps.BitMWord; Switch: TYPE = RoseBehavior.SwitchVal; SwitchMWord: TYPE = LONG DESCRIPTOR FOR PACKED ARRAY CARDINAL OF Switch; Long: TYPE = BitOps.Long; 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]; 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]; 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]; 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]; 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]; 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]; 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. &BitSwOps.mesa Last edited by: Barth, April 12, 1984 2:19:16 pm PST Last Edited by: Spreitzer, September 17, 1985 1:10:59 pm PDT This is companion interface to BitOps that is used for dealing with MOSSIM style values. The containers The externals BOOL and CARDINAL already exist! Extraction and Insertion procedures Bools Cardinals 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 Moving bit fields Word as source Double as source Multiple as source Switch as source Κ}˜Icodešœ ™ K™4K™˜^K˜šœ™K˜Kšœ œ˜ Kšœ œ˜!Kšœ œ˜!Kšœœ˜&Kšœ œœ œœ œœœ˜H—K˜šœ ™ K˜Kšœ ™ Kšœœ˜K˜—šœ#™#K™™K˜Kš ΟbœΠbkœœ7œœ œ˜vK˜Kš Ÿœ œœ œ7œ)˜”K˜Kš Ÿœ œœ œ7œ˜ˆK˜Kš Ÿœ œœœ œ˜QK˜Kš Ÿœ œœ œ<œ˜ŽK˜Kš Ÿœ œœ œ(œ˜‚K˜K˜—šœ ™ K˜Kš Ÿœ œœEœœ œ˜ŒK˜Kš Ÿœ œœ œEœ)˜ͺK˜Kš Ÿœ œœ œEœ˜žK˜KšŸœ œœœ™WK™KšŸœ œœLœ™”K™KšŸ#œ œœ8œ™ˆK˜K˜—™K˜Kš Ÿœ œœEœœ˜„K˜KšŸœ œœSœ)˜’K˜KšŸœ œœSœ˜–K˜—K˜—K˜šœ™K˜šœ™K˜Kš Ÿœ œœOœgœ)˜ŽK˜Kš Ÿœ œœOœgœ˜‚K˜—K˜šœ™K˜Kš Ÿœ œœPœgœ)˜‘K˜Kš Ÿœ œœPœgœ˜…K˜K˜—šœ™K˜Kš Ÿœ œœPœgœ)˜“K˜Kš Ÿœ œœPœgœ˜‡K˜——˜šœ™K˜Kš Ÿœ œœSœcœœ˜‡K˜Kš Ÿœ œœSœdœœ˜‹K˜Kš Ÿœ œœSœdœ˜μK˜Kš Ÿœ œœSœgœ˜κK˜——Kšœ˜J˜—…—<ί