Homework 4
Student Database - an LC-3 Assembly Language Program

Due on Tuesday, December 4, 2007 at 11:59 pm

Outcomes

After successfully completing this assignment, you will be able to...

Before Starting

Read Chapters 6 and 7.

Description of Problem

In this project you'll write a program to process an array of records, where each record contains information about a student's exam scores. For each student in the database, your program will print the student's name, followed by the student's two exam scores, and the calculated average of the exam scores.

Input and Output

The format of each record in the database is as follows: the first item is the name of the student, stored as a zero-terminated ASCII string (one character per word); the second and third items are the student's two exam scores (stored as integers). The database can contain any number of such records, and the last record in the database will be followed by a memory location containing the value x0000. The test scores can take on any value between 0 and #100. The database starts at location x4000.

Given this input:
x4000         'B'
x4001         'e'
x4002         'c'
x4003         'k'
x4004         'e'
x4005         'r'
x4006         x0000
x4007         #94
x4008         #73
x4009         'N'
x400A         'i'
x400B         'c'
x400C         'h'
x400D         'o'
x400E         'l'
x400F         's'
x4010         x0000
x4011         #66
x4012         #53
x4013         x0000
Your program should display this output:
Becker
Exam1:  94  Exam2:  73  Average:  83

Nichols
Exam1:  66  Exam2:  53  Average:  58
The format of your output should look just like the given example.

Hints

This program is more complicated than it might first appear - don't wait until the last minute to do this assignment. Break the program into manageable parts instead of trying to write the whole thing at once. Here is one way you might want to approach this assignment:

There are other ways to break up the assignment; the point is to concentrate on one subtask at a time, test it completely, then move on to the next. Comment as you code!

Design Considerations

Make use of subroutines where appropriate. For example, your routine to convert an integer to an ASCII string, and your routine to strip off leading zero's, should both be coded as subroutines.

Documentation Guidelines

You will be using the LC3Edit program to create your assembly language source file. Follow these formatting and documentation guidelines:

Deliverables

You should turn in two files for this assignment. hw4.asm contains the assembly language code for your program. studentdata.asm contains sample data you used to test your program. Using web-based turnin submit your LC-3 source files before 11:59pm on Tuesday, Dec 4.