CSCE 313 - Embedded Systems Programming
Homework & Lab Assignments
I will attempt to lay out the assignments far enough in advance that you can plan the workload accordingly. I will post assignments on a certain date, with a given due date. Assignments should be completed either on computer or they can be handwritten (but neatly!), when we are doing problems out of the text. For the assignments using the tools, you will be required to provide computer output, with both hardcopy and electronic submissions.
NOTE: As defined by the University policy, in courses where we have both undergraduate and graduate students, I must define two levels of assignments. The undergraduate students in this course will have a lighter workload (as USC expects graduate students to work harder, and have the capacity to do more work, than undergraduate students.) So, each assignment will list those problems that the undergrad students can omit (and you know who you are!). I'll expect the graduate students to turn in the full assignments.
NOTE: Assignments are due in class on the due date, so be prepared. Get stuff printed out before coming to class.
NOTE: For the most part, the assignments in this class will be conducted labs, scheduled for Fridays during the regularly scheduled class period. The lab results must be demonstrated to the Lab Instructor, so you are best served by working the lab during the time allotted in class. We will likely need to schedule an alternate time for completion of the labs so that if you can't finish, or for some valid reason, miss the Lab session, you will be able to make it up. Lab results are due the day of assignment, or due on the day of a Lab makeup (to be determined--so keep watch here!)
| Homework | Assign Date | Due Date | Assignment |
| 1 | Mon 1/12/04 | Wed 1/21/04 | Reading:
MacKenzie Chapters 0 & 1.
Problems: MacKenzie, Chapter 0, problems 1, 5, 6, 7, 10, 11, 23, 24; pages 35-36. Note 1/21/04: For those who haven't gotten their texts yet--and to whom I have now given the handouts for doing this assignment, please note the due date for you is Monday 1/26/04. |
| 2 | Wed 1/21/04 | Fri 1/30/04 | Reading: MacKenzie Chapter 2 (handouts available outside my office door or in class on Friday). Problems: MacKenzie, Chapter 1, problems 3, 4, 9, 10; page 52. |
| 3 | Wed 2/4/04 | Fri 2/13/04 | Problems:
MacKenzie, Chapter 2 (instructions and addressing modes), problems 2, 3,
4, 5, 12, 14, 16, and 30; pp. 77-78.
NOTE 2/9/04 (after class): Do this work and hand it in on Friday 2/13/04 instead of Wednesday. But, don't just give me answers, like for the ones that have answers in the back of the book. Work out the solution on paper, and try to be neat in your description of the solution. We'll look at one or two of these on Wednesday 2/11, Lecture 13. This may seem like a lot, but it's really not. Each one, except the last one, is a single question about addressing modes. The last one is a bunch of separate examples of indicating which modes are being used (the reverse of the others). Think of it like a puzzle to be solved. There's no better way to drill on these fundamentals than to practice recognition of specific addressing modes by their format and content. This will enhance your retention when we get to the actual instructions that use these modes. Better programmers are those who have the best command of the language, its nuances, and how to get to the most efficient method of solving a programming problem. NOTE: I give you some problems where the answers are in the back of the text. Please show your work on these problems, or I will count off points (because I want to you to be able to get some feedback by checking your answers, NOT give you an easy way to turn in homework by copying the answers without working the problems). |
| 4 | Fri 2/6/04 | Fri 2/13/04 | Reading: MacKenzie,
Chapter 3 (instruction set).
Lab Problem: Take this MC680000 program file, download it and use the WISM68 simulator to: (1) assemble the source program, (2) link/load the program, (3) step through the program, one instruction at a time, looking at the contents of both the Registers and Memory. For the homework, you will show me that you have completed the assignment but turning in these deliverables: (1) printout of Listing File generated by WISM68 after program assembly, (2) print-screen JPEG image of the Memory window and Register window (which can be done by hitting the "Print Scrn" key, opening MS-Paint, pasting the PC copy buffer contents into Paint, saving it as HW#4, then printing it--making sure to "fit to page"). The screen printout should be clear enough for me to see the contents of the 68000 registers and memory range where the data is located after you have executed the program by stepping one instruction at a time. This program: ASCBIN-030424.asm NOTE 2/9/04 (after class): I found out from the ENGR systems manager that the permissions have been reset so that we can run WISM68 on the machines downstairs. So try to get this exercise done as soon as possible. Both HW#3 and HW#4 are due Friday 2/13/04. |
| 5 | Wed 2/11/04 | Fri 2/13/04 | Identify someone else in the class to work with as your Lab Partner for the semester. Then download this Template (PDF) form and fill it out and turn it in after class on Friday 2/13. |
| 6 | Wed 2/18/04 | Wed 2/25/04 | MacKenzie, Chapter 3: problems 2, 4, 5, 6 (p.102) These deal with decoding and encoding instructions, and determining the execution times of instructions and instruction sequences. |
| 7 | Wed 2/18/04 | Fri 2/20/04 | Lab problem: You'll
take the program I have posted, download it, simulate it in WISM68.
The program has a known coding "bug" that you need to find and
correct. We'll work this as a timed lab; you'll have to turn in
results by the end of the lab period. You can work with your lab
partner, use your books and notes. You cannot talk to other lab team
members. You will turn in the following at the end of the lab: (1)
The assembled listing of the CORRECTED program, (2) screen shot of the
simulation Register window BEFORE the bug was fixed, and (3) screen shot
of the Register window AFTER the bug was fixed. Attach this cover
page to your Lab.
The program we're using is posted here (and also on the Lectures page): Bubblesort.asm, written by G. La'Trice Johnson (from last summer's CSCE 498) and butchered up by me. Note how I lay my window out when I am doing debug work--see this JPEG image: HW7-debug-desktop.jpg If you want to print this image, make sure you scale to fit the page size first. Hint: as you are trying to find the problem, consider the following approach: consider what types of errors might we possibly have? (1) program control flow errors (helpful to draw a flowchart of the algorithm), (2) wrong instruction, (3) incorrect specification for one or more operands (addressing mode errors), (4) swapped operand order, (5) incorrect operand length, (6) incorrect register specified in an instruction. You'll use the WISM68 to check these possibilities as you walk through the Bubble Sort algorithm. A very important skill is the ability to diagnose problems by troubleshooting, and simulation/debug is the way we do this activity. But, use your mind, and think through the process. |
| 8 | Wed 2/18/04 | Fri 2/27/04 | MacKenzie, Chapter 3: problems 11, 16 (writing code fragments), and 12, 14 (determining what is the result of executing a sequence of instructions. NOTE: You'll complete this assignment by using WISM68 to create your results. So, for each problem, you'll turn in (1) Listing printout, and (2) resultant Register window, after executing the code. |
| 9 | Wed 3/24/04 | Mon 3/29/04 | Note 3/23/04: Because
I wasn't able to get the multi-thread program working in WISM68 as I had
hoped, we move to "plan B" for lab this week.
We'll use the programs and procedures described in Lab #5 - MacKenzie. Get MacKenzie's Lab #5 (PDF) here. The difference is that we'll use WISM68 to edit, assemble and execute the programs. You'll use the Debugging Form in this lab to work each of the problems out by hand, then enter them. As before, I want the following: (1) 68K assembled listing file (.lst), (2) screen shots showing before and after for the Registers window and the Memory window for the WISM68 simulator program, and (3) the worksheet from the MacKenzie lab. Here's the MS-Word file for the debugging exercise that is part of our Assignment #9 (MacKenzie's Lab #5). Get the Word file here: Lab3-DebuggingWorksheetTemplate-03030 (MS-Word) |
| 10 | Mon 3/29/04 | Mon 4/5/04 | We'll use the programs and procedures described in Lab #6 - MacKenzie as the starting point. Get MacKenzie's Lab #6 (PDF) here. We will use the basic interfacing model between the 68000 and the 68681 DUART. The Universal Asynchronous Receiver/Transmitter model is a basic "pattern" used in many systems. I'm assuming we have lab space set up in room 2A16 for this lab. |
| 11 | Mon 4/5/04 | Mon 4/12/04 | We'll use the procedures described in Lab #7 - MacKenzie as the starting point. Get MacKenzie's Lab #7 (PDF) here. I'm assuming we have lab space set up in room 2A16 for this lab as well. |
| 12 | Mon 4/12/04 | Mon 4/19/04 | We'll use the procedures described in Lab #8 - MacKenzie as the starting point. Get MacKenzie's Lab #8 (PDF) here. |
| 13 | Mon 4/19/04 | Mon 4/26/04 | We'll use the procedures described in Lab #11 - MacKenzie as the starting point. Get MacKenzie's Lab #11 (PDF) here. |
| -- | -- | -- | Note 3/23/04! To work some of the MacKenzie labs, you'll need to run through the first few of these to learn how to use the DOS-based tools. This will be radically different from whet we would have been using with the WISM68 simulation environment--an MS-Windows application. If we are indeed able to get the 68KMB hardware up and the associated DOS software running under an OS other than Windows-98, then you'll need to go back and run through the initial MacKenzie labs, namely the following ones: MacKenzie's Lab #1, Lab #2, Lab #3, Lab #4 (PDF). |