# Assembly Language Project

Printing of Table Due: Wednesday, November 12

Computation Due: Friday, November 14

Problem: One organization consists of a federation of chapters, and the chapters pay dues to the central organization according to their income and based on the following table.

Income Dues
Over But not Over Base plus % on income
0 4000 0 + 16% over 0
4000 8000 640 + 17% over 4000
8000 12000 1320 + 18% over 8000
12000 16000 2040 + 19% over 12000
16000 20000 2800 + 21% over 16000
20000 24000 3640 + 22% over 20000
24000 28000 4520 + 23% over 24000
28000 32000 5440 + 24% over 28000
32000 36000 6400 + 27% over 32000
36000 40000 7480 + 29% over 36000
40000 44000 8640 + 31% over 40000
44000 48000 9880 + 33% over 44000
48000 52000 11200 + 34% over 48000
52000 56000 12560 + 35% over 52000
56000 60000 13960 + 36% over 56000
60000 64000 15400 + 37% over 60000
64000 68000 16880 + 38% over 64000
68000 ----- 18400 + 29.25% over 68000
For example, if a chapter has an income of \$37,455 , then its dues are determined from the table by looking at the line for incomes between \$36,000 and \$40,000. Specifically, the chapter pays \$7480 plus 29% of \$1,455 (the income in excess of \$36,000) for a total of \$7901.95 .

Assignment: Write a program that allows users to print out the above table and that computes a chapter's dues. In the process, you will need to put together several of aspects of HP assembly language, including moving data, addressing, computation, branching, and input/output.

To get started, following these steps:

1. Consider how the data for the above table can be stored efficiently. Your representation should be flexible, in that the program should allow the number of categories to expand (e.g., in the future there may be a category for incomes between \$68,000 and \$72,000). Also, it should be easy to change specific percentages for any category. You may assume, however, that all categories (both now and in the future) will be in increments of \$4,000, beginning at \$0.00 .

2. Using `~walker/211/labs/proj-code.c` as a basic shell, write a program that solves the above problem. Thus, beginning with the above program, compiled to assembly, add appropriate elements (written in HP Assembly Language) to store the table and handle all table mechanisms (including the printing of the data table).

3. Once the table is printed, add assembly code to handle the computation and printing of a chapter's dues. (Reading and printing already are handled in the above shell. Overall, HP Assembly Language must be used for each of the following:

• printing the above table (calling I/O functions from C libraries as desired),
• computing the dues for that chapter.

Writeup: Your final writeup should contain a discussion of how the data for the table are organized, a listing of the (appropriately commented) assembly language program that solves the problem, and some sample runs of the program.

Extra Credit: While the entries in the above table may seem somewhat peculiar, there is some logic behind the various percentages, and this table was actually used by one organization. Explain the logic behind the significant drop in the dues rate quoted for the categories between the \$64,000-\$68,000 line and the over \$68,000 line.

This document is available on the World Wide Web as

```http://www.math.grin.edu/~walker/courses/211/assem-project.html
```

created October 1, 1997
last revised November 10, 1997