Lab 5 -- Function Calls and the Stack

Due: Wednesday, October 10th by 11:55pm

Introduction

In this lab you will be exploring assembly implementation of C-procedure calls. You may work in groups.

The assignment consists of the following steps:

  1. Download the source file: lab5.c
  2. Compile the C-code to assembly.
  3. Starting with the assembly leading into the function call "func1"; draw the stack changes over time until the function returns storing the result in variable ret.

Please use a 32-bit machine (e.g., one of the Jazz machines).

This lab should be very useful for understand how the stack works and help significantly on the upcoming midterm and the bomb project (distributed after the midterm).

You are welcome submit the assignment digitally (via Moodle), or slip it under Matt's office door by the deadline.