コード例 #1
0
 public YZXBit this[int BIndex]
 {
     get
     {
         if (!BIndex.InRange(0, 31, true))
         {
             throw new InvalidOperationException();
         }
         int    realIndex = UintIndex * 8 + BIndex;
         YZXBit bit       = Mermory.B[realIndex];
         return(bit);
     }
 }
コード例 #2
0
 public YZXBit this[int BIndex]
 {
     get
     {
         if (BIndex.InRange(0, 15, true))
         {
             int    realIndex = UshortIndex * 16 + BIndex;
             YZXBit bit       = Mermory.B[realIndex];
             return(bit);
         }
         throw new InvalidOperationException();
     }
 }
コード例 #3
0
        /// <summary>
        /// 映射模块到内存区域的某一个部分
        /// 信息记录在每个YZXBit上
        /// </summary>
        /// <param name="begin">起始</param>
        /// <param name="length">长度</param>
        /// <param name="unit">模块</param>
        public void Map(ushort begin, ushort length, YZXUnit unit)
        {
            for (ushort i = 0; i < length; i++)
            {
                YZXUshort us = this[begin + i];
                us.Unit = unit;
                us.UShortIndexInUnit = i;

                for (int j = 0; j < 16; j++)
                {
                    YZXBit b = us[j];
                    b.Unit = unit;
                    b.UShortIndexInUnit = i;
                    b.BitIndexInUnit    = j;
                }
            }
        }