public void EmitsData()
        {
            var instr = new DeclareData <ushort>(0xABCD, 0xEF01);

            Assert.AreEqual(new ushort[] { 0xABCD, 0xEF01 }, instr.Data);


            var emittable = instr.Construct(Context).First() as RawEmittable;

            Assert.AreEqual(new byte[] { 0xCD, 0xAB, 0x01, 0xEF }, emittable.Content);
        }
Exemplo n.º 2
0
        public void EmitsData()
        {
            Func <Context, SimpleExpression> expression = (context) => new SimpleExpression(context.Address);
            var size  = DataSize.Bit32;
            var instr = new DeclareData(expression, size);

            Assert.AreEqual(expression, instr.Expression);
            Assert.AreEqual(size, instr.Size);

            Int128 value = 0xDEADBEEF;

            Context.Address = value;

            var emittable = instr.Construct(Context).First() as ExpressionEmittable;

            Assert.AreEqual(value, emittable.Expression.Constant);
            Assert.IsNull(emittable.Expression.Reference);
            Assert.AreEqual(size, emittable.Size);
        }