This repository contains the sample C programs which were used to demo x86-64 assmebly language and GDB.
Created for CS0449: Introduction to System Software at the University of Pittsburgh
Since we are working with x86-64 assembly language, we will need a machine that supports such an architecture. Students enrolled in CS0449: Introduction to System Software are given access to the CS department's Thoth machine which can be accessed via Secure Shell:
ssh USERNAME@thoth.cs.pitt.edu
Once you are logged in, navigate to your private
directory using the change directory command (cd
) and clone the repository:
git clone https://github.com/CS0449/x86-Demo.git
Inspect the source files in the src
directory. There are 3 C source files:
- conditionals.c
- for_loops.c
- while_loops.c These are simple C programs created to demonstrate how various control structures are implemented in C and how they are compiled to assembly.
In the same directory, a Makefile
is provided to aid in compiling. To compile your programs, from the src
directory run:
make
Note by default the programs are compiled using gcc
with the debug option(-g
flag) DISABLED. Since we are focused on inspecting the assembly, seeing the code from within GDB is unnecessary.
To remove the executables, simply run:
make clean