Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

__movsw

Microsoft Specific

Generates a Move String (rep movsw) instruction.

void __movsw( 
   unsigned short* Dest, 
   unsigned short* Source, 
   size_t Count 
);

[out] Dest

The destination of the operation.

[in] Source

The source of the operation.

[in] Count

The number of words to copy.

Intrinsic

Architecture

__movsw

x86, x64

Header file <intrin.h>

The result is that the first Count words pointed to by Source are copied to the Dest string.

This routine is only available as an intrinsic.

// movsw.cpp
// processor: x86, x64
#include <stdio.h>
#include <intrin.h>

#pragma intrinsic(__movsw)

int main()
{
    unsigned short s1[10];
    unsigned short s2[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
    __movsw(s1, s2, 10);

    for (int i = 0; i < 10; i++)
        printf_s("%d ", s1[i]);
    printf_s("\n");
}
0 1 2 3 4 5 6 7 8 9

Community Additions

ADD
Show:
© 2015 Microsoft