《操作系统》的实验代码。
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

40 wiersze
1.0 KiB

9 lat temu
  1. #include <stdio.h>
  2. void A();
  3. void B(int a, int b, int c);
  4. int main()
  5. {
  6. A();
  7. return 0;
  8. }
  9. void A()
  10. {
  11. unsigned int a = 1;
  12. unsigned int b = 2;
  13. unsigned int c = 3;
  14. B(a,b,c);
  15. }
  16. void B(int d, int e, int f)
  17. {
  18. int g;
  19. unsigned int _ebp;
  20. __asm__(
  21. "movl %%ebp,%0\n\t" \
  22. :"=r" (_ebp));
  23. g=4;
  24. printf(" [ebp-12] --?? = %p --- %d \n [ebp-08] --?? = %p --- %d \n [ebp-04] --?? = %p --- %d \n [ebp+00] -oebp= %p --- %p \n [ebp+04] -ret = %p --- %p \n [ebp+08] -- d = %p --- %d \n [ebp+12] -- e = %p --- %d \n [ebp+16] -- f = %p --- %d \n ",
  25. (unsigned *)(_ebp-12), *(unsigned *)(_ebp-12),
  26. (unsigned *)(_ebp-8), *(unsigned *)(_ebp-8),
  27. (unsigned *)(_ebp-4), *(unsigned *)(_ebp-4),
  28. (unsigned *)(_ebp), *(unsigned *)(_ebp),
  29. (unsigned *)(_ebp+4), *(unsigned *)(_ebp+4),
  30. (unsigned *)(_ebp+8), *(unsigned *)(_ebp+8),
  31. (unsigned *)(_ebp+12), *(unsigned *)(_ebp+12),
  32. (unsigned *)(_ebp+16), *(unsigned *)(_ebp+16));
  33. }