XCHG() public method

XCHG mem8,reg8
public XCHG ( ByteMemory target, R8Type source ) : void
target ByteMemory
source R8Type
return void
Esempio n. 1
0
	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.");
	}
Esempio n. 2
0
	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.");
	}
Esempio n. 3
0
	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.");
	}
Esempio n. 4
0
	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.");
	}
Esempio n. 5
0
	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.");
	}
Esempio n. 6
0
	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.");
	}
Esempio n. 7
0
	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.");
	}
Esempio n. 8
0
	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.");
	}
Esempio n. 9
0
	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.");
	}