Proj3 FA19

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

CS221 PROJECT #3

This project focuses on the use of a stack to pass parameters to a recursive procedure.

For this project the stack should be increased, you decide by how much, based on your
first few runs of test data. You can reuse code of previous labs and projects.

For this project, you must be able to assemble, link, and execute assembler programs,
use the stack to pass parameters and use recursive procedure calls as covered in
Lab #4. Do Lab #4 before this project.

For Project #3, you must write an assembly language program that meets the following
specifications:
 The program must prompt the user for an integer number, which will be used to
determine the Fibonacci number, the Fibonacci number is a sequence of integers of
the following form 1,1,2,3,5,8,12, etc where the series starts with 1,1 and every
succeeding value is the sum of the two previous values. Echo to the user the input
parameter in a nicely formatted way.

 The program must compute the nth value of the Fibonacci series using recursion ,
use the formula fn = fn-1 + fn-2 and the base cases are f0 = 1 and f1 = 1.
Make liberal use of whitespace to have a nicely formatted output.

 Change the text printed by the Greet procedure so that it prints an appropriate title
or name for the program, your name as programmer, and the date on which you
turn in your project.

 Your program must work correctly with any proper 16 bit integer.

 Your program must use recursive procedure (subroutine) calls to solve the problem.
Use the BP register to access the parameters on the stack without popping them off.
The stack must be cleaned when the procedure returns to itself and the main calling
program.

 Your code must be well structured and it must have comments that make it read like
a high level language with assembly language code inserted after each of the lines
of high level language.

TO RECEIVE CREDIT FOR YOUR PROJECT:

Email your asm source file and programmer’s manual (with screen captures) to us
with the subject heading “CS221 Proj. 3”.

You might also like