

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Lab; Professor: He; Class: Microcomputer Systems; Subject: ECE Elect & Computer Engr; University: Tennessee Tech University; Term: Spring 2008;
Typology: Lab Reports
1 / 3
This page cannot be seen from the preview
Don't miss anything!


The purpose of this lab is to reinforce your basic programming skills with the 68HSC using program loops, arrays, comparisons, and arithmetic instructions.
Prepare pseudocode and the first draft of the program and calculate the expected results by hand (both decimal and hex). This must be completed before coming to the lab and shown to the lab instructor at the start of the lab session. Note: The Pre-Lab must be typed into a proper *.ASM source file, following our standard Program Format requirements.
_Approved: Lab TA _____________________ Date _____________
Write a fully-commented program for the HC12 board, following our standard Program Format requirements (http://iweb.tntech.edu/rhaggard/3120s08/Program_Format.htm), including appropriate directives and labels for memory operands and constants, called Minmax.asm. It must use a program loop and comparisons for most of the work. The program should do the following:
The program directives should initialize the following signed decimal data word array in the data space (starting at $1200): 105, -32768, 2100, -1450, 5, 24542, -128, -32760, -1, 1, -81, 32767, -24444, 256, 0 in this order.
The program should store in memory:
Procedure : First, use D-Bug12 to fill memory locations $1000 through $14FF with zeros. Then assemble, download, and debug/execute the program as follows. a. Set a breakpoint to stop execution at the end of each loop and run through the program to the end, pausing at each breakpoint to display the important values. Verify that each value is correct at the end of each loop and that all final results are correct at the end of the program. Use the listing file to determine the breakpoint address. Remember that the instruction at the breakpoint address is NOT executed when the break occurs; it is only executed when you resume execution after the break. b. Then reset the processor (which removes the breakpoint), download the program again, run it at full speed until it stops, and verify that the four final values are still correct. c. When finished debugging and executing, copy the entire terminal window output and paste it into a Notepad or Word document for inclusion in the report. You should edit out mistakes and unnecessary repetitions before submission.
_Approved: Lab TA _____________________ Date _____________