CS130 Homework 4

due Feb 6 (Don't hand in but do prior to quiz!)

Assembly Programs

1. Write a program that calculates the sum of numbers entered by a user until a negative number is entered. It will then print the sum of numbers entered by the users excluding the negative number.
So if a user enters 5 8 3 -2, the program will print  out 16 (5 + 8 + 3).

2. Write a program that reads in 4 positive numbers and then prints out the integer mean of the 4 numbers (the average number as an integer)
If a user enters 12 8 5 2,  the computer will print out the value  6 (the integer part of 27/4).  Remember that we can do division by seeing how many times we can subtract a number.

3. Write a program that will read in a number and print a one if the number was odd and print a zero if the number was even.