CSCE 313 - Embedded Systems Design

Homework #6

Lab problem: You'll take the program I have posted here, Bubblesort.asm, 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 was written by G. La'Trice Johnson (a former student) and butchered up by me.  When using the WISM68K tools, note how I lay my window out when I am doing debug work--see this JPEG image: HW6-debug-desktop.jpg  If you want to print this image from MS-Paint, 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, or,

(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.