CS 273 Lab 9: Debug my Sensors

Dept. of Computer Science, NMSU

Fall 2006

Due Date: Thursday session Nov. 2; Tuesday session Nov. 7

This is a team assignment. Individuals do not need to work on their own solution. Team members should work together, and should avoid trying to solve the problem on their own.

In the last lab, you will access an already-assembled program that would print out the values of light sensors in the gdl comm window. It was the program debugsensors.s19.

For this lab, you need to write this program yourself. You need two versions of your program:

Your program must have at least the following procedures or functions:

  1. A procedure that takes an 8-bit value as one argument, a 0/1 flag as a second argument, and returns an 8-bit value as a return value, where the return value is the ASCII value of the lower hex digit (flag==0) or the ASCII value of the upper hex digit (flag==1) of the input value. (Recall that an 8-bit value is represented in hexadecimal as two hex digits. In your program you need to calculate and print each digit separately.)
  2. A procedure that takes an 8-bit value and outputs it on the serial comm window of gdl (using HC11 serial communications).

For this assignment, you must submit your assembly programs through the web, you must demonstrate one of them to a TA or the instructor, and you must submit a team lab report.