CS 273

Homework 5

Due Friday, October 26, 2001

No reading assignment this week.

Not From the Book

Background

If you are given a corner and the center of a rectangle, you can compute the other three points of the rectangle. It doesn't matter which corner you are given, the computation is the same. Think about the diagonal across the rectangle that starts at the corner you are given. The center of the rectangle is the midpoint of that line, thus, you can use the midpoint formula and a little algebra to calculate the corner at the other side of the diagonal. Once you have that, the rest is easy. Work it out on paper before you start programming. Also make sure you pay attention to how you use the HC11 registers.

Assignment (30 points)

Write an assembly program to computes the other three corners given one corner and the center point of the rectangle. Your program should:

You may (in fact, you probably will) find it helpful to start by writing the program in some imperative high-level language of your choice, and translate that program into assembly code. But that's not an explicit part of the assignment.

Assemble, simulate, and debug your program before submitting it through the Web Submission page. Note: You will receive no points for a program that does not assemble.


Last modified: Fri Oct 19 22:55:34 MST 2001