Exemple #1
0
        public Instruction Resolve(BitArray rawInstruction)
        {
            if (_instructionFactory != null)
            {
                return(_instructionFactory.Create());
            }

            foreach (var resolverConfig in _opSizes)
            {
                var sample = rawInstruction.CopySlice(_offset, (int)resolverConfig.Key);

                if (resolverConfig.Value.TryGetValue(sample.ToUnsignedInt(), out var resolver))
                {
                    var result = resolver.Resolve(rawInstruction);

                    if (result != null)
                    {
                        return(result);
                    }
                }
            }

            return(null);
        }
Exemple #2
0
 public string Format(BitArray data, uint position)
 {
     return(Strategy.Format(data.CopySlice(Offset, Size), position));
 }