private static void TestAssembler(IReadOnlyList<X86Instruction> instructions)
{
var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "test.bin");
using (var stream = File.Create(path))
{
var writer = new BinaryStreamWriter(stream);
var assembler = new X86Assembler(writer);
foreach (var instruction in instructions)
assembler.Write(instruction);
}
ValidateCode(instructions, File.ReadAllBytes(path));
}