Exemplo n.º 1
0
        public static string Offset(this string address, string offset)
        {
            string     newAddress = "";
            YZXAddress a          = new YZXAddress(address);
            YZXAddress na         = a.Offset(offset);

            newAddress = na.ToString();
            return(newAddress);
        }
Exemplo n.º 2
0
        public YZXAddress Offset(string offset)
        {
            string[] ss = offset.Split(AddressDelimiterChars);
            if (ss.Length.InRange(1, 2, true))
            {
                YZXAddress na = new YZXAddress(mIndex, wIndex + ss[0].ToShort());

                if (ss.Length == 2)
                {
                    int bitoffset = ss[1].ToShort() + bIndex;

                    int rem = 0;
                    int div = Math.DivRem(bitoffset, 8, out rem);

                    na.wIndex += div;
                    na.bIndex  = (short)rem;
                }
                return(na);
            }
            else
            {
                throw new InvalidOperationException();
            }
        }