CS 2700: Assembly Language and Computer Architecture

Spring 2024 - Lab 2

Due 4/22

Turn your final .mas file in via Canvas.

  1. Use one of the Windows machines in DBH 288 -- the black machines on the rows closer to the back of the room.
  2. Log in with your OIT user name and password so that you will be able to save any files you work on for later use.
  3. Visit our textbook's official web site, select the "SAMPLE MATERIALS" tab, and download the MARIE Simulator file.
  4. Double-click on 'MARIE_Simulator.zip". Most Windows machines will automatically "unzip" (uncompress the file, compressed into the zip file format) if you double-click on the file name.
  5. In Windows, open the Windows Explorer, go to Downloads or Desktop -- wherever your web browser placed the unzipped MARie simulator files.
  6. Copy the marieSim.jar file out into a folder that is not inside the Windows zip file viewer. (Your Desktop is a good choice.) Double-click on the copy of marieSim.jar.
  7. 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
    

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

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

  10. 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.

  11. Upload the working and tested source code (.mas) to Canvas by the assignment deadline. Some of the lab points are given for showing up and diligently working on the lab where the professor can see you working.