CS 2700: Assembly Language and Computer Architecture

Spring 2015 - Lab 2

Due 4/24 by 6pm

  1. Log in with your CS lab user name and password so that you will be able to save any files you work on for later use. (On Windows, you will need to save your files to the T: drive to be able to use them later.)

  2. "java -jar /Applications/MarieSim/marieSim.jar" is the command to run MARIE from the command line in the Mac OS; double-clicking on MarieSim.jar in a Mac Finder window will also start it. In Windows, open the Windows Explorer, go to "Computer", then the "Bootcamp" drive, then "Program Files", then "MarieSim" and double-click on marieSim.jar.

  3. Write and run a complete MARIE assembly program to do this:

    Read in from the user and store in X a numerical value.
    Calculate X2  and store it in Y
    Output Y to the user
    

  4. You may assume the user will only input a positive integer or 0 for X.

  5. Hint: Recall your elementary school multiplication tables. 3 * 3 = 9 = 3 + 3 + 3.

  6. N.B.: MARIE's output window is, by default, set to display characters in ASCII. Unless the value your program outputs is a displayable character ('a' instead of the space character) you may not be able to see output from your program until you reset the window to display in Hex or Dec.

  7. Upload the working and tested source code (.mas) to the CSHomework system by the assignment deadline.

Last updated 4/16/2015