tags:

views:

50

answers:

1

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 something
}
+2  A: 
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
}
karlphillip
simple and cool! :)
jyzuz