Shahid4

Issue 5570 tests gcc iasm

Oct 26th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. typedef short S;
  2. typedef struct s7_  { S a,b,c,d, e,f,g;     } s7;
  3.  
  4. s7 func_ret_s7( void )
  5. {
  6.     s7 x;
  7.     x.a = 1;
  8.     x.b = 2;
  9.     x.c = 3;
  10.     x.d = 4;
  11.     x.e = 5;
  12.     x.f = 6;
  13.     x.g = 7;
  14.     return x;
  15. }
  16.  
  17. // Dump Registers here
  18. struct REG { long r1,r2; } reg;
  19.  
  20. void main( void )
  21. {
  22.     asm(
  23.     "call func_ret_s7\n"
  24.     "mov %rax, reg\n"
  25.     "mov %rdx, reg+8\n"
  26.     );
  27.  
  28.     printf(" Reg1: 0x%lx \n", reg.r1 );
  29.     printf(" Reg2: 0x%lx \n", reg.r2 );
  30. }
Advertisement
Add Comment
Please, Sign In to add comment