1 2 /* Test for long-form encodings of push %reg */ 3 4 #include <stdio.h> 5 6 int foo ( int x ) 7 { 8 int block[2]; 9 block[0] = x; 10 block[1] = 0; 11 __asm__ __volatile__( 12 "movl $0,%%edi\n\t" 13 "movl $0,%%esi\n\t" 14 "movl %0,%%edi\n\t" 15 ".byte 0xFF,0xF7\n\t" /*pushl %edi */ 16 "popl %%esi\n\t" 17 "movl %%esi, %1" 18 : : /*in*/ "m"(block[0]), "m"(block[1]) : "esi","edi","memory" 19 ); 20 return block[1]; 21 } 22 23 int main ( void ) 24 { 25 int i; 26 for (i = 0; i < 100000000; i += 11111111) 27 printf("%d %d\n",i,foo(i)); 28 return 0; 29 } 30