Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collapse the table of content
Expand the table of content


Microsoft Specific

Generates a store string instruction (rep stosq).

void __stosb( 
   unsigned __int64* Dest, 
   unsigned __int64 Data, 
   size_t Count 

[out] Dest

The destination of the operation.

[in] Data

The data to store.

[in] Count

The length of the block of quadwords to write.





Header file <intrin.h>

The result is that the quadword Data is written into a block of Count quadwords in the Dest string.

This routine is only available as an intrinsic.

// stosq.c
// processor: x64
#include <stdio.h>
#include <intrin.h>

#pragma intrinsic(__stosq)

int main()
   unsigned __int64 val = 0xFFFFFFFFFFFFI64;
   unsigned __int64 a[10];
   memset(a, 0, sizeof(a));
   __stosq(a+1, val, 2);
   printf("%I64x %I64x %I64x %I64x", a[0], a[1], a[2], a[3]); 

0 ffffffffffff ffffffffffff 0
© 2015 Microsoft