test2.cpp

来自「汇编内核的MD5算法C源码,核心运算部分采用汇编语言编写」· C++ 代码 · 共 40 行

CPP
40
字号
// test2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#define a esi
#define b edi
#define c edx
#define d ebx
#define tmp1 eax
#define tmp2 ecx

#define FF(a, b, c, d, x, s, ac)\
	__asm mov tmp1,b\
	__asm and tmp1,c\
	__asm mov tmp2,b\
	__asm not tmp2\
	__asm and tmp2,d\
	__asm or tmp2,tmp1\
	__asm add tmp2,x\
	__asm add tmp2,ac\
	__asm add a,tmp2\
	__asm rol a,s\
	__asm add a,b\


int main(int argc, char* argv[])
{
	unsigned int x=0;

	__asm mov a,0x1
	__asm mov b,0x2
	__asm mov c,0x3
	__asm mov d,0x4

	FF(a, b, c, d, x, 0, 0);

	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?