EE 361 LAB 2 MC68HC11 Program Debugging References: EE361 texts, MC68HC11 Reference Manual Schedule: Week of: 9/15 Pre-lab due Week of: 9/22 Programs demonstrated 1 Pre-Lab: The pre-lab is to be handed in at the start of the lab. Submit a memo report to answer the following questions: What do the following monitor commands do?: MD, RM, MM, T, BR. What does each of the following monitor routines do and how do you use them? OUTSTRG0, OUTLHLF, and OUTRHLF. 2 Using the Buffalo Monitor, assemble the following program at $c000. After you have entered it, trace through it one step at a time. Explain to your lab instructor what you see on the screen. In particular, explain what is happening to the condition code register at each step. LDX #C000 LDAB #2 LOOP LDAA 0,X INX DECB BNE LOOP SWI 3 Assemble the following program. The program is to allow you to enter a character from the keyboard and to print the hexadecimal code used by the computer to represent that character. For example, if you type A after starting the program the display should show A=41. It doesn't do it. Why not? Fix it so it does. Demonstrate to your lab instructor. Operation Operand Comment JSR INCHAR Get a character from terminal TAB Save it temporarily LDAA #3E Load ASCII code for = JSR OUTA Print = TBA Get the data back JSR OUTLHLF Print the left half byte JSR OUTRHLF Print the right half byte SWI Return to the Buffalo Monitor 4 Using elements of this program and other monitor utility routines, modify the program to print A = $41 or B = $42, etc. (including the spaces in the string). Use the OUTSTRG0 monitor routine to do this. 5 Grading: Pre-Lab 5 points, Program demos (part 3, 5 points; part 4, 5 points).