Vous n'êtes pas identifié.
Alors...Ya t'il un moyen plus rapide de passer les données d'un tableau dans un autre :
Soit, par exemple :
char value1[2][2]={1,2,3,4}; char value2[2][2]; int i,j; for(j=0;j<2;j++) for(i=0;i<2;i++) value2[j][i]=value1[j][i];
Vala...c juste pour savoir
Hors ligne
si c un prog en c/c++, tu as la méthode memcpy(void*, const void*, int nbre d'octets)
Normalement cette fonction est plus rapdide.
La fonction en asm je ne la connais pas
Hors ligne
the memcpy function is one of the fastest ways of moving data from one place to another, because it uses string functions.
memcpy( &buffer1, &buffer2, number_of_bytes) function will translate to asm code looking something like this:
mov si, offset buffer1 mov di, offset buffer2 mov cx, number_of_bytes rep movsb
(this is assuming the arrays are in the same segment)
if the arrays are alligned you could speed the function up by using word / dword / qword moves, or on newer cpus you could use block moves
ben voila
la methode asm est la plus rapide
bithwise a oublié de préciser que la source doit être a es:[di] et non pas tt les deux a es:[si/di]
voila
Hors ligne
yes, ofcourse
maybe it was a bit of a hasty comment I posted there
what I ment by assuming they were in the same segment:
when loading the offsets, they are relative to the data segment declared in your program. To copy something from a runtime defined segment, you will have to load 'si' with the offset relative to 'ds', and 'di' with the offset relative to 'es'
btw: does it bother anyone that I post here in English. I've had some years of French in school, which gives me the foundation to understand parts of what's beeing said here, but I'm not good enough to reply in French
ok but beware of the _DS segment (in asm in C (TC3)) it cause to me many 'ununderstoodable' bugs....
Hors ligne
Well In my memory_zone library I have designed powerfull move functions which run the fatest way possible (word/word using rep prefix), and you can move more than 65535 bytes...
To KTr: when you modifie DS you have to push it before and make sure to restore its value before using any extern C variable (and before returning control to your C function) else it will crash...
Hors ligne
arg !!! arg !!! arg !!!
Parlez en francais, je comprends rien du tout ...
( ou alors faites une double traduction)...
M'enfin merci qd meme pour la fonction
Hors ligne
To KTr: when you modifie DS you have to push it before and make sure to restore its value before using any extern C variable (and before returning control to your C function) else it will crash...
I believe you're right but when I programmed this i was a newbie (like today....)!
Hors ligne
more than 65535Ko...
is'nt it more than 65536 o ???
c po plus de 65536 o???
Ya ya you're right it's 65535 bytes of course we don't have 65 Mo on the AFX
Hors ligne