Program1 - Fibs

Program1 - Fibs - calculating them from the preceding two...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 322 Program 1: Fibonacci Sequence Due Wednesday, September 28, 2011 You are to write an assembly language program that will calculate and store the first 16 numbers in the Fibonacci sequence. Recall that the Fibonacci sequence starts out with zero followed by one. Each number of the rest of the sequence is the sum of the two preceding numbers in the sequence. Therefore the first sixteen Fibonacci numbers are: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610. You should create the following data segment with only the first two values initialized: .data Fibs dw 0, 1, 14 DUP (0) Your code should then proceed to fill in the missing 14 Fibonacci numbers by
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: calculating them from the preceding two already in the sequence. The assembly language instructions that you will need for this assignment include ( mov , add, and call ). Your code should: 1. Dump out Fibs before you calculate the missing 14 numbers (dump exactly 16 words), 2. Calculate the missing 14 fibs and place them in their correct location in Fibs, and lastly 3. Dump out Fibs with all the correct values (dump exactly 16 words). You should email your .asm file to [email protected] by class time on the due date. The assembly code should be commented – including your name, date, assignment and description. Enjoy!!!...
View Full Document

This note was uploaded on 01/03/2012 for the course CSC 323 taught by Professor Allen during the Fall '11 term at Mercer.

Ask a homework question - tutors are online