Lab 4 -- Function Calls and the Stack

Due date : Wednesday October 13th; by 6am

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: lab4.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.

Be sure you only look at assembly code generated on one of the Jazz machines.

This lab should be very useful for understand how the stack works and help significantly on the upcoming bomb project. I expect that you'll be able to hand in this writeup by the end of lab on Wednesday, but you can wait until the morning after fall break.

It is assumed that you will do this assignment by hand, so submissions can either be directly to the instructor, in his mailbox, or under his office door.