fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a;
  5. int* p;
  6. int b[3]={127,65537,11113};
  7. __asm__ volatile (
  8. "mov %2,%%ecx\n\t"
  9. "lea %2,%%edx\n\t"
  10. "mov %%ecx,%0\n\t"
  11. "mov %%edx,%1\n\t"
  12. : "=m"(a),"=m"(p)
  13. : "m"(b[1])
  14. : "%ecx","%edx");
  15. printf("%p %d\n",p,a);
  16. __asm__ volatile (
  17. "push %%eax\n\t"
  18. "mov %2,%%ecx\n\t"
  19. "lea %2,%%edx\n\t"
  20. "pop %%eax\n\t"
  21. "mov %%ecx,%0\n\t"
  22. "mov %%edx,%1\n\t"
  23. : "=m"(a),"=m"(p)
  24. : "m"(b[1])
  25. : "%ecx","%edx");
  26. printf("%p %d\n",p,a);
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
0xbfb2e188 65537
0xbfb2e184 127