简体   繁体   中英

Memory-to-memory copy

Is there a mechanism of efficiently simulating a memory-to-memory copy using x86 instructions?

I need to guarantee an instant in time when both the source address and the destination address point to equal values. I am currently using a loop (ie do { reg = *A; *B = reg; } while (reg != *A) ), but I'd like to optimize on that.

EDIT: Missed some important information: I'm copying pointers.

REP MOVSB(google it),还有WORD和DWORD版本,现在可能还有QWORDs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM