Skip to content
Snippets Groups Projects
Commit ef357cf0 authored by Thierno-Souleymane Bah's avatar Thierno-Souleymane Bah
Browse files

feat(display_stack programm done))

parent dac65dfc
No related branches found
No related tags found
No related merge requests found
*.o
*.s
display_stack
\ No newline at end of file
Makefile 0 → 100644
all: display_stack
display_stack : display_stack.o
gcc -o $@ $^
%.o:%.c
gcc -c $<
clean:
rm -f *.o *.s display_stack
#include <stdio.h>
int display(int pa, int pb, int pc)
{
printf("pa=%p; pb=%p; pc=%p\n", &pa, &pb, &pc);
return 0;
}
int main()
{
int a, b;
int la, lb, lc;
asm("movl %%esp, %0"
"\n\t"
"movl %%ebp, %1"
: "=r"(a), "=r"(b));
printf("esp=%p; ebp=%p\n", &a, &b);
printf("la=%p; lb=%p; lc=%p\n", &la, &lb, &lc);
return display(la, lb, lc);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment