I apologize ahead of time as I know this thread is old but I have two items, one that might help and the second item are some questions:
Here is my suggestion to do this using 64 bit registers and not the FPU:
Code: Select all
Macro I_Swap(a,b) ; New Macro
!mov r8 ,qword[a_#a]
!mov r9 ,qword[a_#b]
!mov [a_#a], r9
!mov [a_#b], r8
EndMacro
Macro mySwap(a,b); 32bit & 64bit x86
!fld qword[a_#a#]
!fld qword[a_#b#]
!fstp qword[a_#a#]
!fstp qword[a_#b#]
EndMacro
A_Size.i = 200 ; Be able to consistently change the size of the array
Dim tableau1(A_Size):Dim tableau2(A_Size)
For i=0 To A_Size
tableau1(i)= 10000000 + 10 + i
tableau2(i)= 10000000 + 100 + i
Next
For i=0 To A_Size
Debug tableau1(i)
Debug tableau2(i)
Next
Debug "Swap it:"
;mySwap(tableau1,tableau2)
I_Swap(tableau1,tableau2) ; New Macro
For i=0 To A_Size
Debug tableau1(i)
Debug tableau2(i)
Next
I hope this provides a better solution by not using the FPU .
Now the questions:
In working with the above code, I now find that you can work with arrays in assembler (have not been able to find any documentation about it anywhere).
It also seems that the code in the macro will walk through the whole array in one pass/command/macro.
Is there any more documentation about this, any place?
Is there any more documentation about how to access other types, like structures, in ASM?
Thanks!