Project 1

First Assembler Programs

Due: Wed, Jan. 24

 

This assignment is in 2 parts to step you up to where you need to be.

Program 1.    This program is to let you become accustomed to the MARS Simulator.  Write a program that takes 3 values, a, b and c, (defined as variables in the data section with initial values), then computes b+(a-c) and prints out the result.  There should be good text output with the resulting number.

Program 2.  Read in two values from the keyboard.  Calculate and print out the sum, difference, product and quotient/remainder along with the original input values.  Run it with several test cases.  Try a test case where the two operands are 7 digits each (They can be held as a 32-bit register can hold 2^32 which is approximately 4,000,0000,000).  Explain why you get a strange result.