[ create a new paste ] login | about

Link: http://codepad.org/wmJ3CxxI    [ raw code | output | fork ]

C, pasted on Feb 23:
#include <stdio.h>

int F1(double x, double y)  
{
    int i[3];
    double n;

 /*hier adresse von SBP und SP angeben*/
    unsigned ebp,esp;
    asm volatile ("movl %%ebp,%0" : "=r" (ebp));
    asm volatile ("movl %%esp,%0" : "=r" (esp));
    printf("%lX\n%lX\n",ebp,esp);


    n = 6.04 * x - 8.5;

    return (n);
}

int main()  
{
      unsigned ebp,esp;
    asm volatile ("movl %%ebp,%0" : "=r" (ebp));
    asm volatile ("movl %%esp,%0" : "=r" (esp));
    printf("%lX\n%lX\n",ebp,esp);
    double a, b, c;
       printf("%lX\n%lX\n",ebp,esp);
    a = 10;
    b = 10;

    F1(a, b);
   printf("%lX\n%lX\n",ebp,esp);
    return 0;
}


Output:
1
2
3
4
5
6
7
8
FFFA3D28
FFFA3CF0
FFFA3D28
FFFA3CF0
FFFA3CE8
FFFA3CB0
FFFA3D28
FFFA3CF0


Create a new paste based on this one


Comments: