Assembly Language Programming

Course Index 
Dr. Margush's page 

Program 1 - Bit Walker

This program will use switch 0 and the 8 LED's to display a moving bit (illuminated LED). The other switches should be ingored. The byte begins with bit 0 (LED 0) illuminated, all others off. Each press of SW 0 walks the bit to the next highest numbered position (LED). When the bit "falls out" into the proverbial bit bucket (from position 7), the program stops (enters an infinite loop). You can restart the program by resetting the processor. 

You must deal with switch bounce in this program so the bit does not walk two steps with one button press. There are several ways to make the bit "walk." Look at the bit patterns of x+x compared to x (where x is any byte) for one clue. Provide adequate documentation and an elegant solution for full credit. You may work in pairs to complete this assignment.

A printed copy of the nicely formatted program is due in class. Be sure to document the program, including the elimination of switch bounce. The program should be designed for a 1 MHz clock speed. If working on a team, submit only one program for the team.

Use the homework submission server to upload the single assembly language source file.

Return to Dr. Margush's page