I want to concatenate array1 array2 ... to one array how is fast way:
.data
array1 db 0CFh, 0C2h, 0ABh, 01Bh, 0C1h, 007h, 0F7h, 06Dh, 0DAh, 0F2h, 0DCh, 03Ch....; about 2000 dup
...
array2 db 0BFh, 03Dh, 087h, 0F1h, 0A6h, 097h, 0A6h, 05Bh, 010h, 0F2h, 051h, 05Eh ...
.data ?
arrayOut dd ?
.code
invoke crt_memcpy, array, addr array1, sizeof array1
mov ecx, [arrayOut]
add ecx,sizeof array1
invoke crt_memcpy,dword ptr[ecx], addr array2, sizeof array2 ???
I also try use code as below:
mov eax, 0
mov ecx, sizeof array1 *2
mov edi, 0
mov esi, 0
L1:
mov al, [array1 + esi * TYPE BYTE]
movsx eax, al
mov arrayOut[esi], eax
cmp ecx,esi
jbe GoOnNext
inc esi
loop L1
GoOnNext:
mov ecx, sizeof array2 *2
mov edi,0
L2:
mov bl, [array2 + edi * TYPE BYTE]
movsx ebx, bl
mov arrayOut[esi], ebx
cmp ecx,edi
jbe nextstep
inc esi
add edi,1
loop L2
nextstep:
mov eax, arrayOut
But if the size of the array is large, I get the wrong result。