本文整理汇总了C#中Reg8类的典型用法代码示例。如果您正苦于以下问题:C# Reg8类的具体用法?C# Reg8怎么用?C# Reg8使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Reg8类属于命名空间,在下文中一共展示了Reg8类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromNameWB
public static OpCode FromNameWB(string op, Reg16 op1, Reg8 op2)
{
byte b;
switch (op)
{
case "movzx":
b = 0xb6;
break;
case "movsx":
b = 0xbe;
break;
default:
throw new Exception("invalid operator: " + op);
}
return OpCode.NewBytes(Util.GetBytes4(0x66, 0x0f, b, (byte)(0xc0 + (((int)op1) << 3) + op2)));
}
示例2: FromNameB
public static OpCode FromNameB(string op, Reg16 op1, Reg8 op2)
{
byte b;
switch (op)
{
case "movzx":
b = 0xb6;
break;
case "movsx":
b = 0xbe;
break;
default:
throw new Exception("invalid operator: " + op);
}
return new OpCode(new byte[] { 0x66, 0x0f, b, (byte)(0xc0 + (((int)op1) << 3) + op2) });
}
示例3: ShiftW
public static OpCode ShiftW(string op, Reg16 op1, Reg8 op2)
{
byte b;
switch (op)
{
case "shl":
case "sal":
b = (byte)(0xe0 + op1);
break;
case "shr":
b = (byte)(0xe8 + op1);
break;
case "sar":
b = (byte)(0xf8 + op1);
break;
default:
throw new Exception("invalid operator: " + op);
}
if (op2 != Reg8.CL)
throw new Exception("invalid register: " + op2);
else
return new OpCode(new byte[] { 0x66, 0xd3, b });
}
示例4: ShiftB
public static OpCode ShiftB(string op, Reg8 op1, byte op2)
{
byte b;
switch (op)
{
case "shl":
case "sal":
b = (byte)(0xe0 + op1);
break;
case "shr":
b = (byte)(0xe8 + op1);
break;
case "sar":
b = (byte)(0xf8 + op1);
break;
default:
throw new Exception("invalid operator: " + op);
}
if (op2 == 1)
return OpCode.NewBytes(Util.GetBytes2(0xd0, b));
else
return OpCode.NewB(Util.GetBytes2(0xc0, b), op2);
}
示例5: ShiftB
public static OpCode ShiftB(string op, Reg8 op1, byte op2)
{
byte b;
switch (op)
{
case "shl":
case "sal":
b = (byte)(0xe0 + op1);
break;
case "shr":
b = (byte)(0xe8 + op1);
break;
case "sar":
b = (byte)(0xf8 + op1);
break;
default:
throw new Exception("invalid operator: " + op);
}
if (op2 == 1)
return new OpCode(new byte[] { 0xd0, b });
else
return new OpCode(new byte[] { 0xc0, b }, op2);
}
示例6: FromName1B
public static OpCode FromName1B(string op, Reg8 op1)
{
switch (op)
{
case "inc":
return OpCode.NewBytes(Util.GetBytes2(0xfe, (byte)(0xc0 + op1)));
case "dec":
return OpCode.NewBytes(Util.GetBytes2(0xfe, (byte)(0xc8 + op1)));
case "not":
return OpCode.NewBytes(Util.GetBytes2(0xf6, (byte)(0xd0 + op1)));
case "neg":
return OpCode.NewBytes(Util.GetBytes2(0xf6, (byte)(0xd8 + op1)));
case "mul":
return OpCode.NewBytes(Util.GetBytes2(0xf6, (byte)(0xe0 + op1)));
case "imul":
return OpCode.NewBytes(Util.GetBytes2(0xf6, (byte)(0xe8 + op1)));
case "div":
return OpCode.NewBytes(Util.GetBytes2(0xf6, (byte)(0xf0 + op1)));
case "idiv":
return OpCode.NewBytes(Util.GetBytes2(0xf6, (byte)(0xf8 + op1)));
default:
throw new Exception("invalid operator: " + op);
}
}
示例7: FromNameB
public static OpCode FromNameB(string op, Reg8 op1)
{
switch (op)
{
case "inc":
return new OpCode(new byte[] { 0xfe, (byte)(0xc0 + op1) });
case "dec":
return new OpCode(new byte[] { 0xfe, (byte)(0xc8 + op1) });
case "not":
return new OpCode(new byte[] { 0xf6, (byte)(0xd0 + op1) });
case "neg":
return new OpCode(new byte[] { 0xf6, (byte)(0xd8 + op1) });
case "mul":
return new OpCode(new byte[] { 0xf6, (byte)(0xe0 + op1) });
case "imul":
return new OpCode(new byte[] { 0xf6, (byte)(0xe8 + op1) });
case "div":
return new OpCode(new byte[] { 0xf6, (byte)(0xf0 + op1) });
case "idiv":
return new OpCode(new byte[] { 0xf6, (byte)(0xf8 + op1) });
default:
throw new Exception("invalid operator: " + op);
}
}
示例8: SalBAR
public static OpCode SalBAR(Addr32 op1, Reg8 op2)
{
return ShiftBAR("sal", op1, op2);
}
示例9: ShrBAR
public static OpCode ShrBAR(Addr32 op1, Reg8 op2)
{
return ShiftBAR("shr", op1, op2);
}
示例10: ShlBR
public static OpCode ShlBR(Reg8 op1, Reg8 op2)
{
return ShiftBR("shl", op1, op2);
}
示例11: ShlB
// Shl, Shr, Sal, Sar
public static OpCode ShlB(Reg8 op1, byte op2)
{
return ShiftB("shl", op1, op2);
}
示例12: AndBR
public static OpCode AndBR(Reg8 op1, byte op2)
{
return FromName2BR("and", op1, op2);
}
示例13: ShlWAR
public static OpCode ShlWAR(Addr32 op1, Reg8 op2)
{
return ShiftWAR("shl", op1, op2);
}
示例14: AndB
public static OpCode AndB(Reg8 op1, Reg8 op2)
{
return FromName2B("and", op1, op2);
}
示例15: SarWAR
public static OpCode SarWAR(Addr32 op1, Reg8 op2)
{
return ShiftWAR("sar", op1, op2);
}