Beispiel #1
0
        public static OpcodeEncoder AppendMod(this OpcodeEncoder encoder, bool memory, Operand displacement)
        {
            if (memory)
            {
                if (!displacement.IsConstant)
                {
                    return(encoder.Append2Bits(Bits.b00));
                }

                if (displacement.IsConstantZero)
                {
                    return(encoder.Append2Bits(Bits.b00));
                }

                if (Is8BitDisplacement(displacement))
                {
                    return(encoder.Append2Bits(Bits.b01));
                }

                return(encoder.Append2Bits(Bits.b10));
            }

            return(encoder.Append2Bits(Bits.b11));
        }
Beispiel #2
0
 public static OpcodeEncoder AppendMod(this OpcodeEncoder encoder, byte value)
 {
     return(encoder.Append2Bits(value));
 }