CS280 -- Lab 2: Bouncing Light
Spring 2007
Overview
The purpose of this lab is to gain some experience with branching, loops,
and the bit instruction set.
Problem Statement
In this lab, you will design, code, assemble, simulate, download and run
a program. The program must produce the "Knight Rider" effect. Specifically:
- Begin with all but the left most LED off.
- Continue moving the lit LED to the right. (Turn on the neighbor to the right and turn off the current LED.)
- Once the right most LED has been reached, repeat the process in the oposite direction until it reaches the left most position.
- Repeat forever
Notes:
- One, and only one, LED should be lit while the program is running.
- Recall that the LEDs are active low, i.e., logic 0 is LED on, logic 1 is LED off.
- A delay loop should be added so that only one LED at a time appears to be lit.
- You should make use of bit instructions to perform the LED movement.
- The ROR and ROL bit instructions may be useful.
- You are not allowed to use a look-up table for this program.
Pre-laboratory activity (due on entering the week 3 lab)
Smile
Laboratory Demonstration (due 11pm the day prior to week 4 lab)
You must demonstrate your program working on your board.
Laboratory Report (due 11pm the day prior to week 4 lab)
You should submit
the .lst for your program using the
online submission form.
- Add .nolist before and
.list after the
.include "m32def.inc" in your
.asm file
- The beginning of your source file should contain:
- Your name
- Submission date
- Program name
- "Lab 2"
- A brief (couple sentences) description of something interesting
you discovered while working on this assignment
Acknowledgment
This assignment is based on a similar assignment developed by
Dr. Steve Barnicki.