/* personal notes of renzo diomedi */
~ 00011011 ~
cs.c ____ gcc -S cf.c ----> cf.s
To transfer control of a program to a function you need to use the Stack
Stack needs an INDIRECT Addressing (it uses a Pointer to a Memory location instead directly same memory location)
here below is an example concerning IA32
First indirect address of SP is copied in BP. Then inserting (push) new values, SP increases.
Pushing the registers onto the stack before the function code, and Popping them off
when the function is ready to return to the calling program
prog.c ........ screen.s ........ screen.o ........ screen
gcc -fpie -o prog prog.c screen
prog
objdump -D prog > disassembled_prog
disassembled_prog
squari.c ........ squarint.s
gcc -fPIE -o squari squari.c squarint.s
squari
objdump -D squari > squaridump
squaridump
~ back ~