CS 210 PROJECT #4 Due Date: Noon Tuesday 04/21/09 The purpose of this project is to provide students with experience in designing a useful assembly language program which must be linked to one or more separately assembled external procedures and which does not call any functions in the standard C runtime library. PROBLEM STATEMENT Design an interactive assembly language program which calculates a student's GPA (Grade Point Average) in response to a series of messages that prompt for the numbers of academic units the student has completed at each academic grade-level. (The GPA is based on a 4-point scale and should be displayed with 2-place decimal accuracy.) Below is the console output from a sample terminal session showing messages your program should display and typical responses by a user: $ ./gpa TO FIND OUT YOUR GRADE-POINT-AVERAGE, PLEASE ANSWER EACH QUESTION BELOW: HOW MANY UNITS OF 'A' WORK? 9 HOW MANY UNITS OF 'B' WORK? 18 HOW MANY UNITS OF 'C' WORK? 21 HOW MANY UNITS OF 'D' WORK? 0 HOW MANY UNITS OF 'F' WORK? 3 TOTAL CREDITS TAKEN: 51 TOTAL POINTS EARNED: 132 GRADE-POINT-AVERAGE: 2.59 $ The main difficulty in this project is handling the conversions between decimal representation of the numerical input and output and the binary representation of those values that are required internally as operands for the CPU's arithmetic instructions. Fortunately, the conversion-routines you need are already designed in 'uint2rax.s' (for string-to-number) and in 'rax2uint.s' (for number- to-string), already discussed in class and posted on our class website. You may assemble those files as written, by using the commands: $ as uint2rax.s -o uint2rax.o $ as rax2uint.s -o rax2uint.o The GNU linker utility (named 'ld') will allow you to link them to your main object-module, using command-lines like these: $ as gpa.s -o gpa.o $ ld gpa.o uint2rax.o rax2uint.o -o gpa There remains the issue of how you will display the Grade-Point-Average as a fixed-point decimal (rounded correctly to two decimal-places), but some ways of handling that will be discussed during class. _______________________________________________________________________ Allan B. Cruse University of San Francisco Spring 2009