Please give me a star if this was useful to you!
This project aims to design and implement a StackFrame module that provides the functionality to establish the base pointer and return address in the caller’s stack frame and also print out stackframe data. This project helps understand stack frames through inline assembly with x86-64 in AT&T syntax.
See Makefile for the build scripts.
To build the TryStackFrames executable, simply run make at the command line in the current directory.
To compile and run the test suite, run make Tests.
Important: the command make clean will try to delete any executable or .o files in the src directory (tests or main executable files included).
- My program implementation is in StackFrames.c
- The header file has been edited to add MACRO definitions
- The Makefile has been edited to implement to make the test suite executables.
To compile and run the test suite, run make Tests. This will automatically print the Stack Frames for different variants of executeFactorial. The stack frames printed out are for the following factorial numbers: 0!, 1!, 7!, 10!, and 20!.
- TestFactorial0 is a variant almost identical to Factorial but performs factorial(0,1).
- TestFactorial1 is a variant almost identical to Factorial but performs factorial(1,1).
- TestFactorial7 is a variant almost identical to Factorial but performs factorial(7,1).
- TestFactorial10 is a variant almost identical to Factorial but performs factorial(10,1).
- TestFactorial20 is a variant almost identical to Factorial but performs factorial(20,1).