mov ecx, 7 start: mov eax, 0x1234 loop start //loop指令将ecx = ecx -1; 并检测ecx是否为0, 不为0跳到start处, 继续循环; ecx == 0终止循环, 执行下面的指令. ____________________________________________________________________________________________________ 下述代码循环打印数字 int _tmain(int argc, _TCHAR* argv[])
{
int i = 100;
char *str = "%d ";
__asm
{
mov ecx, i
start:
push ecx
push ecx
push str
call DWORD PTR [printf] //注意如何调用内置函数
add esp, 8
pop ecx
loop start
}
return 0;
}
LOOP
原文:http://www.cnblogs.com/goalpower/p/4032613.html