im using inline assembler in VS .net 7.1 and i modify the ebx register wich result in a warning by the compiler but in normal compile mode i never get an error since if ebx, esi, edi is modifyed the compiler preserv those automaticly.

But if i compile in debug mode (edit and cont.) i get errors if the ebx register is modifyed. If i push the ebx register the compiler cant access pointers or variables in the inline asm code.

example:
int test[2]={1,2};
int *pointer=&test[0];


_asm{
mov ebx,0
mov eax,pointer
loop:
.
.
.
.
commands
.
.
.
jnz loop
}

In debug mode i get a crash at "mov eax,pointer" anyone familar with this problem? It seems ebx holds some informations and if overwritte i cant use some variables inside the asm code... This only happens in debug compile mode.
Posted on 2004-06-08 05:17:31 by Andy2222
yeah i've had some problems using ebx in inline asm in msvc6, and 7 i think. Theoretically it should work as a placeholder, but i just switched it to esi/edi, and i didn't have much problems. as for access variables, i've always done "mov reg,dword ptr ", in mostly every case, i'm not sure if this pertains to your case, since int *pointer is already a pointer. try it.
Posted on 2004-06-08 06:06:46 by Drocon