Beispiel #1
0
 public ModRegRM(Mod mod, Register register, Register registerOrMemory, SIB sib)
 {
     Mod              = mod;
     Register         = register;
     RegisterOrMemory = registerOrMemory;
     SIB              = sib;
 }
Beispiel #2
0
        public byte[] Encode()
        {
            var  bytes = new List <byte>();
            byte b     = 0;

            b = EncodeModRegRM(b, Mod, Register?.GetByte() ?? 0, RegisterOrMemory?.GetByte() ?? 0);
            bytes.Add(b);
            if (SIB != null)
            {
                bytes.Add(SIB.Encode());
            }

            if (Displacement != null)
            {
                bytes.AddRange(Displacement.GetBytes(this));
            }

            return(bytes.ToArray());
        }