The eax and ebx registers contain two 32-bit positive integers, while edx contains a pointer to the 1st element of an array of such numbers. How for the smallest amount of instructions to exchange the values ​​of [edx + eax * 4] and [edx + ebx * 4] arrays?

Available commands intel x86, Windows .

    1 answer 1

    Um ...

      mov ecx, dword ptr [edx+eax*4] xchg ecx, dword ptr [edx+ebx*4] mov dword ptr [edx+eax*4], ecx