CSCI 162 Spring 2018: Computer Architecture Lab - A Simple MARIE program


For this lab, you will write a MARIE assembler language program in a new directory.
  1. Log in to your computer, and go into your directory for CSCI 162 files. If you don't have one yet, create it in the relevant directory (e.g., your home directory) by entering the command "mkdir csci162".

    "ls csci162" to see what's in that directory.

    "cd csci162" to enter the directory.

    Make a subdirectory lab4 using "mkdir lab4"

    Now open the MARIE simulator through the drop-down menu Applications -> Other -> MARIE Simulator. If you are working on your laptop, you can download the MARIE simulator at: Student Resources for Computer Architecture (Null and Lobur). If you don't have time to download it now, use the web version (hosted at VIU-CSCI) or the web version from github.

    Take the short tour.
  2. Enter the following program (which is in the MARIE Assembler Language) into the space for a program.

    load x
    add y
    store z
    halt
    x, hex a
    y, hex b
    z, hex 2
  3. Save the file using the File drop down menu; write it to a file named lab1.mas in your csci162/lab2/
  4. What is in the memory locations 4, 5 and 6? Step through the execution of the code using the "Step" button. Watch the AC register -- what happens when "load x" is executed? Note what happens when "Store z" is exectud in the memory location 6.

    Change it so that it outputs the answer in decimal -- get z into the AC register and execute and "output" instruction.

    What do you think will happen if you have no HALT instruction at the end of the program? Somebody in the lab should try it and report what happens.

  5. Change the program so that it takes takes as input two integers in decimal form and outputs each integer in turn (use decimal output) and then outputs their sum.
  6. Use the program to determine what the numbers 7F and AA are in decimal, and what is their sum, in both decimal and hex.
  7. Write a MARIE assembler program that does the following: