ASM and C question
I was wondering... is it possible to.. let's say copy:
int arr1[50];
int arr2[20];
To cope the first 20 in the arr1 to the arr2 using
__asm in visual studio?
Yes, but there's not much point. If you use std::copy() the compiler will likely generate the same or better code than you would using assembly.
Try this:
__asm { lea esi,arr1 lea edi,arr2 mov ecx,20 rep movsd};
Still.. It's pretty pointless in itself, an intrinsic memcpy should be equally fast (probably even faster since it can interleave the instructions freely with nearby code).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement