Example #1
0
 protected static IEnumerable <object[]> GetEncodeData(int codeSize)
 {
     foreach (var info in DecoderTestUtils.GetDecoderTests(includeOtherTests: true, includeInvalid: false))
     {
         if (codeSize != info.Bitness)
         {
             continue;
         }
         yield return(new object[] { info.Bitness, info.Code, info.HexBytes, info.EncodedHexBytes, info.Options });
     }
 }
Example #2
0
        void Verify_ProtectedMode_is_true_if_VEX_XOP_EVEX()
        {
            foreach (var info in DecoderTestUtils.GetDecoderTests(includeOtherTests: false, includeInvalid: false))
            {
                var decoder = Decoder.Create(info.Bitness, new ByteArrayCodeReader(info.HexBytes), info.Options);
                decoder.Decode(out var instruction);
                switch (instruction.Encoding)
                {
                case EncodingKind.Legacy:
                case EncodingKind.D3NOW:
                    break;

                case EncodingKind.VEX:
                case EncodingKind.EVEX:
                case EncodingKind.XOP:
                    Assert.True(instruction.IsProtectedMode);
                    Assert.True(info.Code.IsProtectedMode());
                    break;

                default:
                    throw new InvalidOperationException();
                }
            }
        }