Hello,
I am extremely begginer and at at most novice level for playing with assembly.
I am using Inline asm in C++/CLI. Horrible problem infact could be a bug I obsereved. I passed vector from one function call to another. If I comment the whole code snippet of _asm{....some assembly code here} inside the called function where vector used which are provided to it from other function, then no problem whole vector gets fine and copied to argument of called function successfully in correct manner.
But If uncomment _asm{} I mean if I use _asm{} patch in called function , it corrupts the whole vectors of objects, even single string which is participating as in parameter to the function .Infact every most of arguments as data of called function get corrupts where _asm code used. It just shows for every argument values like npos=4294967295. I was expecting string argument would contain valid "strings" and all other rest of parameter would have their correct states. which I just passed from other functions to that called function.
I am amazed while debugging the exe that even before reaching to the point of "_asm" at code , whole data before "_asm" place gets corrupts. Its just like unbelieveable.
EVEN IF I COMMENT EVERYTHING INSIDE _asm PATCH, AND HAVING JUST _asm{} EMPTY OPENING CLOSING BRACES AFTER _asm KEYWORD, STILL THE PROBLEM HAPPENS
Here If I dont write anything at all inside _asm{} even then problem occurs which I described.
What is it? Why this is so? Is CLI creating problem or I am using inline asm in wrong way?
Do I need to save the states of registers?
Kindly help me out , as I am stuck here.
example code:
strParamType = strReturnType;
if(strParamType.find("IDispatch")!=string::npos)
{
IDispatch* pIDispatch;
_asm
{
mov esi,esp
lea eax,[pIDispatch]
push eax
}
}
Regards
Usman





