CSCI 162 Lab 3: assembly language
and shell programming

Note: part 2 (bash scripting) of the original version of the lab is cancelled following our snow closures/revised schedules.


Schedule:

In the lab of week 7 (Feb. 20) we'll introduce Marie for assembly language programming.

The lab exercise is due at 5pm on Tuesday March 5th (after the study break).


Reference material:


Sample code:

Open Marie (either under Applications->Other->MARIESimulator in our lab, or using the github web interface) and try entering the following in the "Assembly Code" section

        / program to count down from user value to 1
        input               / get the starting value
Top,    skipcond    800     / we're not done while it's > 0
        jump        Done    / if we reach this we're done, go to the end
        output              / print the current value
        subt        decr    / subtract 1 from the current value
        jump        Top     / go back to the top of the loop
Done,   halt                / end the program
decr,   dec         1       / variable named decr, initialized to decimal value of 1

The Marie assembly language code above is roughly the equivalent of

   int acc = 0;
   int decr = 1;
   scanf("%d", &acc);
   while (acc > 0) {
      printf("%d\n", acc);
      acc = acc - decr;
   }


Lab exercises:

Obtain the lab 3 repository using the same techniques as previous labs, i.e.

The remaining instructions for lab 3 are in the README file.


Lab exercises:

Once you have completed all parts of the lab, be sure to add, commit, and push your updates:

REMEMBER: if you miss the add, the commit, or the push then your changes never make it back to the central repository, so they'll never get marked!