CSCI 255
Introduction to Embedded Systems
Fall 2011
Lab #4 - Push the button v2.0
The goal of this assignment is to gain experience using subroutines, improve your assembly language style, and practice using the integrated debugger in the Keil IDE.
You should do this lab individually (even if you submitted as a pair for lab #3).
As assembly language is closer to the hardware, it is also further from being human-readable.
Rewrite your program from lab #3 to make it beautiful. This includes:
Create a single subroutine to replace the nested delay loops in your countdown and island explosion code.
Use comments to clearly describe what different parts of your program do.
Use descriptive names for all labels.
Use the EQU assembler directive to give friendly names to ports used for input/output (button, buzzer and LEDs).
Remove unnecessary instructions and simplify if possible (my solution requires 24h bytes of code memory).
Include a header comment with your name, username, and a description of the program
Using the debugger.
You should test your modified program using the Keil IDE.
After compiling your program, select Debug -> Start/Stop Debug Session
You can step the program using F10 and F11.
While stepping your program, note you can view changes to registers, the accumulator, etc. in the register window.
F10 will step over subroutines while F11 will step into subroutines.
Experiment with inserting breakpoints (F9) and then running the program until it encounters the next breakpoint (F5).
Open up the appropriate Peripherals -> I/O-ports windows so you can observe output to your LEDs and buzzer, and provide input to your button.
Submission.
Submit your program Lost2.asm via Moodle.
Be sure your submitted source file has the required header with your name, username, and a description of the program.
Your program will be graded on functionality, readability and elegance.