ASM and C question

Started by
2 comments, last by Ancient Spirit 18 years, 7 months ago
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?
This world is ruled by big furry CATS!! :)Meow! :)
Advertisement
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).
can you please tell me the way to do it? or atleast direct me to a tutorial?
i wanna learn it just for fun... you know... :)
This world is ruled by big furry CATS!! :)Meow! :)

This topic is closed to new replies.

Advertisement