LOOP

 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;
}

posted on 2014-10-18 10:01  大呵呵  阅读(174)  评论(0编辑  收藏  举报

导航