本文整理汇总了C#中SharpOS.AOT.X86.Assembly.XCHG方法的典型用法代码示例。如果您正苦于以下问题:C# Assembly.XCHG方法的具体用法?C# Assembly.XCHG怎么用?C# Assembly.XCHG使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpOS.AOT.X86.Assembly
的用法示例。
在下文中一共展示了Assembly.XCHG方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XCHG_reg16_rmreg16
public void XCHG_reg16_rmreg16 ()
{
// XCHG BP, SP
// XCHG (R16.BP, R16.SP)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.XCHG (R16.BP, R16.SP);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x66, 0x87, 0xec };
Assert.IsTrue (CompareData (memoryStream, target), "'XCHG BP, SP' failed.");
}
示例2: XCHG_reg32_rmreg32
public void XCHG_reg32_rmreg32 ()
{
// XCHG EDX, ECX
// XCHG (R32.EDX, R32.ECX)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.XCHG (R32.EDX, R32.ECX);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x87, 0xd1 };
Assert.IsTrue (CompareData (memoryStream, target), "'XCHG EDX, ECX' failed.");
}
示例3: XCHG_mem32_reg32
public void XCHG_mem32_reg32 ()
{
// XCHG [GS:ESP], ESP
// XCHG (new DWordMemory(Seg.GS, R32.ESP, null, 0), R32.ESP)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.XCHG (new DWordMemory (Seg.GS, R32.ESP, null, 0), R32.ESP);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x65, 0x87, 0x24, 0x24 };
Assert.IsTrue (CompareData (memoryStream, target), "'XCHG [GS:ESP], ESP' failed.");
}
示例4: XCHG_reg8_rmreg8
public void XCHG_reg8_rmreg8 ()
{
// XCHG DH, BL
// XCHG (R8.DH, R8.BL)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.XCHG (R8.DH, R8.BL);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x86, 0xf3 };
Assert.IsTrue (CompareData (memoryStream, target), "'XCHG DH, BL' failed.");
}
示例5: XCHG_mem16_reg16
public void XCHG_mem16_reg16 ()
{
// XCHG [EBX + EDI*8 + 0x12345678], DX
// XCHG (new WordMemory(null, R32.EBX, R32.EDI, 3, 0x12345678), R16.DX)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.XCHG (new WordMemory (null, R32.EBX, R32.EDI, 3, 0x12345678), R16.DX);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x66, 0x87, 0x94, 0xfb, 0x78, 0x56, 0x34, 0x12 };
Assert.IsTrue (CompareData (memoryStream, target), "'XCHG [EBX + EDI*8 + 0x12345678], DX' failed.");
}
示例6: XCHG_mem8_reg8
public void XCHG_mem8_reg8 ()
{
// XCHG [FS:ECX*8 + 0x12345678], AL
// XCHG (new ByteMemory(Seg.FS, null, R32.ECX, 3, 0x12345678), R8.AL)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.XCHG (new ByteMemory (Seg.FS, null, R32.ECX, 3, 0x12345678), R8.AL);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x64, 0x86, 0x4, 0xcd, 0x78, 0x56, 0x34, 0x12 };
Assert.IsTrue (CompareData (memoryStream, target), "'XCHG [FS:ECX*8 + 0x12345678], AL' failed.");
}
示例7: XCHG_reg32_mem32
public void XCHG_reg32_mem32 ()
{
// XCHG EDI, [EBP + EDX*8 + 0x12345678]
// XCHG (R32.EDI, new DWordMemory(null, R32.EBP, R32.EDX, 3, 0x12345678))
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.XCHG (R32.EDI, new DWordMemory (null, R32.EBP, R32.EDX, 3, 0x12345678));
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x87, 0xbc, 0xd5, 0x78, 0x56, 0x34, 0x12 };
Assert.IsTrue (CompareData (memoryStream, target), "'XCHG EDI, [EBP + EDX*8 + 0x12345678]' failed.");
}
示例8: XCHG_reg16_mem16
public void XCHG_reg16_mem16 ()
{
// XCHG DI, [EBX + ECX*4]
// XCHG (R16.DI, new WordMemory(null, R32.EBX, R32.ECX, 2))
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.XCHG (R16.DI, new WordMemory (null, R32.EBX, R32.ECX, 2));
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x66, 0x87, 0x3c, 0x8b };
Assert.IsTrue (CompareData (memoryStream, target), "'XCHG DI, [EBX + ECX*4]' failed.");
}
示例9: XCHG_reg8_mem8
public void XCHG_reg8_mem8 ()
{
// XCHG AH, [EBX + 0x12345678]
// XCHG (R8.AH, new ByteMemory(null, R32.EBX, null, 0, 0x12345678))
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.XCHG (R8.AH, new ByteMemory (null, R32.EBX, null, 0, 0x12345678));
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x86, 0xa3, 0x78, 0x56, 0x34, 0x12 };
Assert.IsTrue (CompareData (memoryStream, target), "'XCHG AH, [EBX + 0x12345678]' failed.");
}