Why move the data separately when you can do a block write using a REP???
Totally lost.
And yes mov edi,array works fine as long as the selector is correct. However I make it a point to load the full pointer to be safe.
LDS and LES still have their place.
If you wanted to copy dwords just do this:
Code:
unsigned char *test=(unsigned char *)malloc(500);
//C++
//unsigned char *test=new unsigned char[500];
asm {
les edi,dword ptr [test]
cld
mov ecx,500d
mov eax,00000h
rep stosd
and ecx,00003h
rep stosb
}
The first example is wrong in that you should load EDI instead of ESI if you are using STOS(x). For MOVS(x) you must load both ESI and EDI.
Haven't done assembly in some time and I'm a bit rusty at it. In recent times I have no need for it because D3D and MSVC are both fast enough without it.
Salem is right. Follow his advice, I just thought I'd show you how to do it.