1. Write, compile, and load the program
A. In the Data1: window, right click on num1, then left click on Show Location. The value of the initialized variables should appear in the Memory window. Cut and paste the Memory window.
B. Single step through the program using F11 and verify the value of the result in Memory window. Cut and paste the Memory window to show the value of result.
C. What is the value displayed on the LEDs after you single step the line PTT = ~result?
2. Write, compile, and load the program described in Example 2 above.
A. Run the program on the board by pressing the Reset button on the Tower. What are the LED values?
B. Calculate the delay size.
3. Initialize an array with binary numbers 0 to 9. Use a "for loop" to display each array element on the Tower LEDs and have a one-second delay between each display. Define all of the variables as unsigned character. The delay should use inline assembly language.
A. Cut and paste the source code.
B. In the Data1: window, right click on the array name, then left click on Show Location. The initialized data array should appear in the Memory window. Cut and paste the Memory window.
C. Run the program on the board by pressing the Reset button on the Tower. Describe the values of LEDs. What is the last value that you see?
4. Modify the "for loop" in Problem 3 so that it displays numbers starting from 9 down to 0. In other words, the loop should become: for( i=9; i>= 0; i--). Run the program and observe the LED values. Does the loop end?
A. Cut and paste the source code.
B. Run the program by pressing the Reset button on the Tower. Describe the values of LEDs. What is the last value that you see? Does the loop end?