CMPXCHG() public method

CMPXCHG mem8,reg8
public CMPXCHG ( ByteMemory target, R8Type source ) : void
target ByteMemory
source R8Type
return void
Esempio n. 1
0
	public void CMPXCHG_rmreg32_reg32 ()
	{
		// CMPXCHG ECX, ESP
		// CMPXCHG (R32.ECX, R32.ESP)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMPXCHG (R32.ECX, R32.ESP);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0xf, 0xb1, 0xe1 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMPXCHG ECX, ESP' failed.");
	}
Esempio n. 2
0
	public void CMPXCHG_rmreg16_reg16 ()
	{
		// CMPXCHG SP, DI
		// CMPXCHG (R16.SP, R16.DI)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMPXCHG (R16.SP, R16.DI);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x66, 0xf, 0xb1, 0xfc };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMPXCHG SP, DI' failed.");
	}
Esempio n. 3
0
	public void CMPXCHG_rmreg8_reg8 ()
	{
		// CMPXCHG DH, AL
		// CMPXCHG (R8.DH, R8.AL)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMPXCHG (R8.DH, R8.AL);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0xf, 0xb0, 0xc6 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMPXCHG DH, AL' failed.");
	}
Esempio n. 4
0
	public void CMPXCHG_mem32_reg32 ()
	{
		// CMPXCHG [EBP + EBP*4 + 0x12345678], EAX
		// CMPXCHG (new DWordMemory(null, R32.EBP, R32.EBP, 2, 0x12345678), R32.EAX)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMPXCHG (new DWordMemory (null, R32.EBP, R32.EBP, 2, 0x12345678), R32.EAX);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0xf, 0xb1, 0x84, 0xad, 0x78, 0x56, 0x34, 0x12 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMPXCHG [EBP + EBP*4 + 0x12345678], EAX' failed.");
	}
Esempio n. 5
0
	public void CMPXCHG_mem16_reg16 ()
	{
		// CMPXCHG [DS:0x12345678], SI
		// CMPXCHG (new WordMemory(Seg.DS, null, null, 0, 0x12345678), R16.SI)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMPXCHG (new WordMemory (Seg.DS, null, null, 0, 0x12345678), R16.SI);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x3e, 0x66, 0xf, 0xb1, 0x35, 0x78, 0x56, 0x34, 0x12 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMPXCHG [DS:0x12345678], SI' failed.");
	}
Esempio n. 6
0
	public void CMPXCHG_mem8_reg8 ()
	{
		// CMPXCHG [DS:EDX + 0x12345678], DH
		// CMPXCHG (new ByteMemory(Seg.DS, R32.EDX, null, 0, 0x12345678), R8.DH)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMPXCHG (new ByteMemory (Seg.DS, R32.EDX, null, 0, 0x12345678), R8.DH);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x3e, 0xf, 0xb0, 0xb2, 0x78, 0x56, 0x34, 0x12 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMPXCHG [DS:EDX + 0x12345678], DH' failed.");
	}