开发者

In Line Assembly Example

开发者 https://www.devze.com 2023-01-16 12:26 出处:网络
I would like a simple example for how to do the following in in-line assembly, x86, visual studio for (int i=1; i<N; ++i)

I would like a simple example for how to do the following in in-line assembly, x86, visual studio

for (int i=1; i<N; ++i)
{
// do somethi开发者_开发问答ng
}


asm
{
   mov ax, N

   repeat:         
     dec ax
     ; do something
     cmp ax, 0
     jne repeat
}

or also:

asm
{
   mov ecx, N

   repeat:
     ; do something
     loop repeat
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号