/// <summary> /// Overloaded. /// Disassembles an integer to specified bits. /// </summary> /// <param name="H">First Byte</param> /// <param name="HU">Upper Index of the First Byte (7-0)</param> /// <param name="HL">Lower Index of the First Byte (7-0)</param> /// <param name="S">Second Byte</param> /// <param name="SU">Upper Index of the Second Byte (7-0)</param> /// <param name="SL">Lower Index of the Second Byte (7-0)</param> /// <param name="value">Value to be disassembled</param> public static void DecomposeBits(Int32 value, ref Byte H, Int32 HU, Int32 HL, ref Byte S, Int32 SU, Int32 SL) { Int32 Hp = value.SAR(SU - SL + 1) & (1.SAL(HU - HL + 1) - 1); H = (byte) (H & ~Convert.ToByte((1.SAL(HU - HL + 1) - 1).SAL(HL))); H = (byte) (H | Convert.ToByte(Hp.SAL(HL))); Int32 SPart = value & (1.SAL(SU - SL + 1) - 1); S = (byte) (S & ~Convert.ToByte((1.SAL(SU - SL + 1) - 1).SAL(SL))); S = (byte) (S | Convert.ToByte(SPart.SAL(SL))); }
/// <summary> /// Overloaded. /// Disassembles an integer to specified bits. /// </summary> /// <param name="H">First Integer</param> /// <param name="HU">Upper Index of the First Integer (31-0)</param> /// <param name="HL">Lower Index of the First Integer (31-0)</param> /// <param name="S">Second Integer</param> /// <param name="SU">Upper Index of the Second Integer (31-0)</param> /// <param name="SL">Lower Index of the Second Integer (31-0)</param> /// <param name="value">Value to be disassembled</param> public static void DecomposeBits(Int32 value, ref Int32 H, Int32 HU, Int32 HL, ref Int32 S, Int32 SU, Int32 SL) { Int32 Hp = (value.SAR(SU - SL + 1)) & ((1.SAL(HU - HL + 1)) - 1); H = H & ~(1.SAL(HU - HL + 1) - 1).SAL(HL); H = H | Hp.SAL(HL); Int32 Sp = value & ((1.SAL(SU - SL + 1)) - 1); S = S & ~(1.SAL(SU - SL + 1) - 1).SAL(SL); S = S | Sp.SAL(SL); }
/// <summary> /// Overloaded. /// Disassembles an integer to specified bits. /// </summary> /// <param name="H">First Byte</param> /// <param name="HU">Upper Index of the First Byte (7-0)</param> /// <param name="HL">Lower Index of the First Byte (7-0)</param> /// <param name="S">Second Byte</param> /// <param name="SU">Upper Index of the Second Byte (7-0)</param> /// <param name="SL">Lower Index of the Second Byte (7-0)</param> /// <param name="T">Third Byte</param> /// <param name="TU">Upper Index of the Third Byte (7-0)</param> /// <param name="TL">Lower Index of the Third Byte (7-0)</param> /// <param name="value">Value to be disassembled</param> public static void DecomposeBits(Int32 value, ref Byte H, Int32 HU, Int32 HL, ref Byte S, Int32 SU, Int32 SL, ref Byte T, Int32 TU, Int32 TL) { Int32 Hp = value.SAR(SU - SL + 1 + TU - TL + 1) & (1.SAL(HU - HL + 1) - 1); H = (byte) (H & ~Convert.ToByte((1.SAL(HU - HL + 1) - 1).SAL(HL))); H = (byte) (H | Convert.ToByte(Hp.SAL(HL))); Int32 Sp = value.SAR(TU - TL + 1) & (1.SAL(SU - SL + 1) - 1); S = (byte) (S & ~Convert.ToByte((1.SAL(SU - SL + 1) - 1).SAL(SL))); S = (byte) (S | Convert.ToByte(Sp.SAL(SL))); Int32 Tp = value & (1.SAL(TU - TL + 1) - 1); T = (byte) (T & ~Convert.ToByte((1.SAL(TU - TL + 1) - 1).SAL(TL))); T = (byte) (T | Convert.ToByte(Tp.SAL(TL))); }