开发者

In Line Assembly Example

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜