mercredi 8 avril 2020

manipulating strings in Inline intel assembly visual studio

I am trying to put a string from an array into a register, and checking it against other strings(with cmps. I realized I wasn't storing or retrieving data from the strings correctly with the registers.

My current (lacking) understanding is MOV is for integers mainly? And to check strings against each other you should have two pointers to each string and run cmps, which leads me to LEA to get the address of the string?

I've been going through the intel manuals but having a hard time understanding it. MOV, MOVS don't seem to move anything in regards to a string, MOVSD, seemingly take some parameters I do not understand. Any help or guidance is appreciated. Thank you for your time. This is dummy code I am practicing on.

int main()
{
    string arr[] = {"a","b","c","d","e" };
    string a= "ad";
    float test = 3;

    __asm
    {

        mov ebx 0

        //movsd eax,a
        //movs eax, a
        //lea eax,[a] 
        //mov [arr+ebx],eax
    }

Aucun commentaire:

Enregistrer un commentaire