public object TryLookup(
			CodeContext mode, ImmutableLegacyPrefixList legacyPrefixes, Xex xex, byte opcode,
			out bool hasModRM, out int immediateSizeInBytes)
		{
			hasModRM = false;
			immediateSizeInBytes = 0;

			NasmInsnsEntry match = null;
			foreach (var entry in entries)
			{
				bool entryHasModRM;
				int entryImmediateSize;
				if (entry.Match(mode.GetDefaultAddressSize(), legacyPrefixes, xex, opcode, out entryHasModRM, out entryImmediateSize))
				{
					if (match != null)
					{
						// If we match multiple, we should have the same response for each
						if (entryHasModRM != hasModRM) return false;
						if (entryImmediateSize != immediateSizeInBytes) return false;
					}

					hasModRM = entryHasModRM;
					immediateSizeInBytes = entryImmediateSize;
					match = entry;
				}
			}

			return match;
		}
Ejemplo n.º 2
0
		public static EffectiveAddress FromEncoding(CodeContext decodingMode, Encoding encoding)
			=> FromEncoding(decodingMode.GetDefaultAddressSize(), encoding);