當前位置: 首頁>>代碼示例>>C#>>正文


C# Assembly.CMP方法代碼示例

本文整理匯總了C#中SharpOS.AOT.X86.Assembly.CMP方法的典型用法代碼示例。如果您正苦於以下問題:C# Assembly.CMP方法的具體用法?C# Assembly.CMP怎麽用?C# Assembly.CMP使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SharpOS.AOT.X86.Assembly的用法示例。


在下文中一共展示了Assembly.CMP方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CMP_rmreg16_imm16

	public void CMP_rmreg16_imm16 ()
	{
		// CMP AX, 0xa82
		// CMP (R16.AX, 0xa82)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (R16.AX, 0xa82);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x66, 0x3d, 0x82, 0xa };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP AX, 0xa82' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例2: CMP_rmreg32_reg32

	public void CMP_rmreg32_reg32 ()
	{
		// CMP EBP, EBP
		// CMP (R32.EBP, R32.EBP)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (R32.EBP, R32.EBP);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x39, 0xed };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP EBP, EBP' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例3: CMP_rmreg8_imm8

	public void CMP_rmreg8_imm8 ()
	{
		// CMP CH, 0x3
		// CMP (R8.CH, 0x3)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (R8.CH, 0x3);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x80, 0xfd, 0x3 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP CH, 0x3' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例4: CMP_rmreg8_reg8

	public void CMP_rmreg8_reg8 ()
	{
		// CMP CH, CL
		// CMP (R8.CH, R8.CL)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (R8.CH, R8.CL);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x38, 0xcd };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP CH, CL' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例5: CMP_rmreg16_reg16

	public void CMP_rmreg16_reg16 ()
	{
		// CMP SI, AX
		// CMP (R16.SI, R16.AX)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (R16.SI, R16.AX);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x66, 0x39, 0xc6 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP SI, AX' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例6: CMP_mem16_reg16

	public void CMP_mem16_reg16 ()
	{
		// CMP [0x12345678], DI
		// CMP (new WordMemory(null, null, null, 0, 0x12345678), R16.DI)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (new WordMemory (null, null, null, 0, 0x12345678), R16.DI);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x66, 0x39, 0x3d, 0x78, 0x56, 0x34, 0x12 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP [0x12345678], DI' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例7: CMP_mem32_imm8

	public void CMP_mem32_imm8 ()
	{
		// CMP DWord [EDX + EBP*1 + 0x12345678], 0xb
		// CMP (new DWordMemory(null, R32.EDX, R32.EBP, 0, 0x12345678), 0xb)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (new DWordMemory (null, R32.EDX, R32.EBP, 0, 0x12345678), 0xb);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x83, 0xbc, 0x2a, 0x78, 0x56, 0x34, 0x12, 0xb };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP DWord [EDX + EBP*1 + 0x12345678], 0xb' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例8: CMP_mem16_imm16

	public void CMP_mem16_imm16 ()
	{
		// CMP Word [ES:EBP], 0x8ad
		// CMP (new WordMemory(Seg.ES, R32.EBP, null, 0), 0x8ad)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (new WordMemory (Seg.ES, R32.EBP, null, 0), 0x8ad);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x26, 0x66, 0x81, 0x7d, 0x0, 0xad, 0x8 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP Word [ES:EBP], 0x8ad' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例9: CMP_mem32_imm32

	public void CMP_mem32_imm32 ()
	{
		// CMP DWord [ES:0x12345678], 0x6abbff6
		// CMP (new DWordMemory(Seg.ES, null, null, 0, 0x12345678), 0x6abbff6)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (new DWordMemory (Seg.ES, null, null, 0, 0x12345678), 0x6abbff6);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x26, 0x81, 0x3d, 0x78, 0x56, 0x34, 0x12, 0xf6, 0xbf, 0xab, 0x6 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP DWord [ES:0x12345678], 0x6abbff6' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例10: CMP_reg32_mem32

	public void CMP_reg32_mem32 ()
	{
		// CMP EDI, [ESI*8]
		// CMP (R32.EDI, new DWordMemory(null, null, R32.ESI, 3))
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (R32.EDI, new DWordMemory (null, null, R32.ESI, 3));
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x3b, 0x3c, 0xf5, 0x0, 0x0, 0x0, 0x0 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP EDI, [ESI*8]' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例11: CMP_mem8_imm8

	public void CMP_mem8_imm8 ()
	{
		// CMP Byte [DS:0x12345678], 0x7
		// CMP (new ByteMemory(Seg.DS, null, null, 0, 0x12345678), 0x7)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (new ByteMemory (Seg.DS, null, null, 0, 0x12345678), 0x7);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x3e, 0x80, 0x3d, 0x78, 0x56, 0x34, 0x12, 0x7 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP Byte [DS:0x12345678], 0x7' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例12: CMP_reg16_mem16

	public void CMP_reg16_mem16 ()
	{
		// CMP SI, [0x12345678]
		// CMP (R16.SI, new WordMemory(null, null, null, 0, 0x12345678))
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (R16.SI, new WordMemory (null, null, null, 0, 0x12345678));
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x66, 0x3b, 0x35, 0x78, 0x56, 0x34, 0x12 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP SI, [0x12345678]' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例13: CMP_reg8_mem8

	public void CMP_reg8_mem8 ()
	{
		// CMP BL, [DS:0x12345678]
		// CMP (R8.BL, new ByteMemory(Seg.DS, null, null, 0, 0x12345678))
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (R8.BL, new ByteMemory (Seg.DS, null, null, 0, 0x12345678));
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x3e, 0x3a, 0x1d, 0x78, 0x56, 0x34, 0x12 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP BL, [DS:0x12345678]' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例14: CMP_mem32_reg32

	public void CMP_mem32_reg32 ()
	{
		// CMP [ECX], EDX
		// CMP (new DWordMemory(null, R32.ECX, null, 0), R32.EDX)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (new DWordMemory (null, R32.ECX, null, 0), R32.EDX);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x39, 0x11 };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP [ECX], EDX' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs

示例15: CMP_rmreg32_imm32

	public void CMP_rmreg32_imm32 ()
	{
		// CMP EBP, 0xea3f51f
		// CMP (R32.EBP, 0xea3f51f)
		MemoryStream memoryStream = new MemoryStream ();
		Assembly asm = new Assembly ();
		asm.CMP (R32.EBP, 0xea3f51f);
		asm.Encode (memoryStream);
		byte [] target = new byte [] { 0x81, 0xfd, 0x1f, 0xf5, 0xa3, 0xe };
		Assert.IsTrue (CompareData (memoryStream, target), "'CMP EBP, 0xea3f51f' failed.");
	}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:11,代碼來源:X86.cs


注:本文中的SharpOS.AOT.X86.Assembly.CMP方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。