loopnz 循环条件是 寄存器cx !=0 标志位ZF !=1
int main(){ int x = 4; __asm { mov eax, [x]; mov cx, 99d; mov ebx, 10d; next1: cmp eax, ebx; 如果相等 zf 置1 pushf; popf; jz outt; inc eax; loopnz next1; outt: mov [x], eax; } cout << x; system("pause"); return 0; }
无限循环
__asm { mov cx, 99d; next1: inc cx; loop next1; }
时间: 2024-10-16 09:21:23