Homework8

A Quiz

You are to implement a humorous quiz.

What programming language do you prefer?
    1 - C++
    2 - Java
    3 - LC-3
    4 - Programming languages are for losers; I program in machine code.
Answer: 4

What is your favorite drink while programming?
    1 - Green Tea
    2 - Bawls
    3 - Dew
    4 - H 2 0
Answer: 2

Who is your favorite professor?
   1 - Professor from Gilligan's Island
   2 - Nutty Professor
   3 - Professor Longhair
   4 - Professor Davies
Answer: 1

Hmmm. I thought your mother raised you better.


To implement this you might have a data file like (sorry for the long weird lines):


.ORIG 	x3300

Q1    	 .STRINGZ  "\nWhat programming language do you prefer?\n   1 - C++\n   2 - Java\n   3 - LC-3\n   4 - Programming languages are for losers; I program in machine code.\n"
Val_A1   .FILL    #2
         .FILL    #5
         .FILL    #10
         .FILL    #8

Q2    	 .STRINGZ  "\nWhat is your favorite drink while programming?\n   1 - Green Tea\n   2 - Bawls\n   3 - Dew\n   4 - H20\n"
Val_A2   .FILL    #8
         .FILL    #10
         .FILL    #5
         .FILL    #2

Q3    	 .STRINGZ  "\nWho is your favorite professor?\n   1 - Professor Longhair\n   2 - Professor from Gilligan's Island\n   3 - Nutty Professor\n   4 - Professor Davies\n"
Val_A3   .FILL    #5
         .FILL    #8
         .FILL    #2
         .FILL    #10

Result1	.STRINGZ  "\nTerrible! You get an 'F'!"
Result2	.STRINGZ  "\nHmm, I thought your mother raised you better."
Result3	.STRINGZ  "\nNot bad, kid.  You have good taste."
Result4	.STRINGZ  "\nExcellent!  "

	.END

Basic Design

  1. Display question 1.
  2. Get answer, as an integer between 1-4, for question 1.
  3. Determine the points for the answer and increment the total points.
  4. Display question 2.
  5. Get answer, as an integer between 1-4, for question 2.
  6. Determine the points for the answer and increment the total points.
  7. Display question 3.
  8. Get answer, as an integer between 1-4, for question 3.
  9. Determine the points for the answer and increment the total points.
  10. Display a result based on the user's total.

Requirements

  • You must use a function call to get the integer answer to each question. The function will prompt for an integer, store the integer in R0, and convert the integer from ASCII to a decimal value. (Be sure to save the values of any registers that you modify.)
  • You must use a function call to determine the value of each answer. You should store the value of each answer in consecutive memory locations. Before calling the function, put the number of the answer in R0 and the memory location of the point value of the first answer in R1. Use the value in R0 to determine which memory location to read the score from. Upon completion of the function, the value of the answer should have been added to whatever register you are using to keep track of the running total. (Be sure to save the values of any registers that you modify.)
  • You must store your quiz questions, answers, and point values in a separate data file.

Submission.

Please Zip your programs(Please, no rar) into one archive file and submit this archive using the turnin script at http://rosemary.umw.edu/~raz/turnin/turnin.php

Comments

Agena

Program does not match requirements. Makes no use of subroutines.

Conroe

Did the same yet again and submitted object files.

Kentsfield

Submitted a single .s file and no assembly files

Troy

Program does not assemble.