4.5 Bit fields, rotate instructions, and shift instructions4 Schedule4.3 Introduction to Assembly Programming4.4 Flow of Control

4.4 Flow of Control

4.4.1 Reading and Web Sites

  1. Read about the following instructions, pay attention to the flags used by the instructions.

4.4.2 Notes

4.4.3 Lab Assignment, Fibonacci & Factorial

 

Write a program in assembly language that:

  1. Prints your name, class (CIS250) and the date.
  2. Print out "Factorial Series"
  3. Compute and print the first 10 values of the factorial series. It starts like 1, 2, 6, 24, 120, .... This program uses the for statement construct.
  4. Print out another header "Fibonacci"
  5. Prints out the first 20 Fibonacci number along with their index. Keep computing more numbers until an arithmetic carry occurs (unsigned overflow). While you do this print every fifth (5th) number. Also print the last number computed and its index before the carry (unsigned overflow) occurred. This section will us INC, ADD, CMP, and Jcc to approximate both if statements and a do statement. The sequence starts like this 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987

Turn in a printed error free listing and the output of your program. Include a copy of any testing that you did to verify the program was correct. For this lab, use a spreadsheet to help your testing.


Instructor: Louis Taber, louis dot taber dot at dot pima at gmail dot com (520) 206-6850
My web site: Home site in Cleveland, OH
The Pima Community College web site

4.5 Bit fields, rotate instructions, and shift instructions4 Schedule4.3 Introduction to Assembly Programming4.4 Flow of Control