CS 2700: Assembly Language and Computer Architecture

Spring 2015 - Lab 1

Due 4/15 by 4pm (new deadline)

Due 4/3 by 5pm (old deadline)

With thanks to Jeff Shafer at the University of the Pacific for inspiration.

  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. MARIE assembly language programs are saved in ".mas" files (which are plain text). Use "File -> Edit" to open assembly language editor in MARIE simulator.

  4. Download Ex4_1.mas, or copy it out of the /Applications/MarieSim folder to your Desktop or other personal folder, and use "File -> Open" (from the editor window) to open it in the MARIE editor.

  5. MARIE command line:
    Label, opcode operands / comments

  6. Instructions for assembler:

  7. In editor window, use "Assemble -> Assemble Current File". This will produce several files, one of which is the ".mex" file that contains machine code the simulator can use.

  8. In editor window, use "Assemble -> Show assembly listing". What do you see? What are the references for the symbol "One"?

  9. In simulator window, use "File -> Load" and select .mex file from previous step.

  10. Run the program, identify what all the sub-windows do, particularly the window on the bottom.

  11. Use "Run -> Set stepping mode -> On" and restart ("Run -> Restart") the program simulation, this time using the "Step" button to watch changes one step at a time.

  12. With a partner or on your own, write and run a complete MARIE assembly program to do this:

    if Y > X then
       Y = Y - 5;
       X = X + Y;

    Show me the running code with X = 1410 and Y = 1010. Be prepared for me to ask you to demonstrate other X and Y values.