Exemplo n.º 1
0
        public override void Decode(Decoder decoder, ref Instruction instruction)
        {
            Debug.Assert(decoder.state.Encoding == EncodingKind.Legacy);
            OpCodeHandler handler;
            var           prefix = decoder.state.mandatoryPrefix;

            if (prefix == MandatoryPrefix.PF3)
            {
                decoder.ClearMandatoryPrefixF3(ref instruction);
                handler = handlerF3;
            }
            else if (prefix == MandatoryPrefix.PF2)
            {
                decoder.ClearMandatoryPrefixF2(ref instruction);
                handler = handlerF2;
            }
            else
            {
                Debug.Assert(prefix == MandatoryPrefix.None || prefix == MandatoryPrefix.P66);
                handler = handlerNormal;
            }
            if (handler.HasModRM)
            {
                decoder.ReadModRM();
            }
            handler.Decode(decoder, ref instruction);
        }