Advertisement
Guest User

Untitled

a guest
Jul 27th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     struct
  6.     {
  7.         int a;
  8.         int b;
  9. #ifdef PAD
  10.         char pad[PAD];
  11. #endif
  12.     } c;
  13.  
  14.     c.a = 1;
  15.     c.b = 2;
  16.  
  17.     int Count = sizeof(c);
  18.     void *Dest = &c;
  19.  
  20.     asm ("rep; stosb"
  21.          : "+D" (Dest), "+c" (Count),
  22.            "=m" (*(struct {int x[sizeof(c)];} *) &c)
  23.          : "a" (0)
  24.          );
  25.  
  26.     printf("%u %u\n", c.a, c.b);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement