Community Programming Exercise

 


 

Overview The assignment provides practice passing parameters on the stack and checking for computation errors..

Assignment

Design an algorithm that iteratively computes the factorial of a number x, and x raised to the x power. This algorithm should be called by a program that prompts the user for this parameter and then prints a message to the user with the result of the computation. Pass parameters via the stack . No global variables are permitted.

Write your code during the first 30 minutes of class. Do not assemble it or debug it. If you finish early, wait patiently.

During the second 30 minutes of class, you will shift places with another student and assemble and, if necessary, debug their code. Get the code to the point where it will assemble without errors but do not execute it.

During the last 30 minutes of class, you will shift places with a third student and, if necessary, debug their code for runtime errors.

 

If you do not finish a part of the assignment in the allotted time, move onto the next part of the assignment anyway.

 

 

Turn in

  1. Cover Page - Your name, date, and Community Programming Exercise Staple all pages together.
  2. Assembler program (the code that you work on during the LAST 30 minutes of class).
  3. Answer the following questions:

        a.    What was challenging about debugging assembly-time errors?

        b.    What was challenging about debugging run-time errors?

        c.    What did you learn as a result of this exercise as far as how you should write code that others will work on?