CS 2700: Assembly Language and Computer Architecture

Spring 2024 - Lab 1

Due 4/10 by 5pm

Thanks to Jeff Shafer at the University of the Pacific for inspiration.

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

  8. Download Ex4_1.mas, or copy it from the unzip folder to your Desktop or other personal folder. Use "File -> Edit" to open the editor. Use "File -> Open" (from the editor window) to open Ex4_1.mas in the MARIE editor.

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

  10. Instructions for assembler:

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

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

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

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

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

  16. 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;
    else
       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.