cs216 class

CS 216, System Programming Languages

Comprising low-level "Assembly language", the C language, and the Linux operating system

2022, Covid Continues...

This year, like the last, the course is on-line, and last year students were on their own for lab work. This year there is a scheduled lab, however the instructions are adaquate for if you choose to work from home, anywhere in the world. Two people have already asked about not coming to campus, and I have replied, "stay home",

The scheduled lab has 2 advantages:

Course Outline

Videos to replace lectures

Current Lab instructions - Lab list

If this link is not "Current" use the lab list!

Labs could possibally be done J-118 or N-113 during the pandemic, or using your own computer at a ditance, by conecting with linux.ubishops.ca.

Online Course notes

These notes are meant to supplement the textbook, with more examples and explanations. Generally, the note chapters correspond to the book chapters.

A classic C tutorial

My notes on C

Sample Final Exam

Sample midterm / review questions

2018 practice midterm

Some C notes, 29 January 2010

Using Macros in Assembly Language

C and mips, side by side

The example programs in the book, and some of my own,  are on linux.ubishops.ca in our course directory, /home/COURSES/cs216, sub-directory examples, the programming questions are in quests.


  1. Assignment 1, binary arithmetic, due Friday, 28 January 2022
  2. Assignment 2, Hex arithmetic, and 2 MIPS instructions, due Friday, 18 February 2022
  3. Assignment 3, Boolean algebra and pseudo instructions, due 18 March 2022
    Possible answers

Lab instructions:

Weekly lab period of: Due end of the week (Midnight Friday). Start early! Subject to change

Connection trouble? see Troubleshooting

  1. Lab 1, 19 January addition.a, easy.a
  2. Lab 2, 26 January math2.a and (math6.a OR math7.a )
  3. Lab 3, 2 February loop4.a,
  4. Lab 4, 9 February MIPS program loop6.a, and C program minmax.c
  5. Lab 5, 16 February MIPS program logic7.a and C program changecase.c.
  6. Lab 6, 23 February MIPS programs bits.a and  stack2.a
  7. - Reading Week --
  8. Lab 7, 9 March MIPS program funct7.a and C program oddeven.c
  9. Lab 8, 16 March MIPS program recur1.a OR recur3.a recommended if you are having trouble
  10. Lab 9, 23 March , C program to evaluate an arithmetic expression,  evalprefix.c
  11. Lab 10, 30 March, MIPS program calctree.a, evaluate a binary expression tree, recursively.
  12. Lab 11, 6 April, C program to merge two ordered lists, merge.c
  13. -OR-
  14. Lab 12, 6 April, using make -- a C sorting project involving multiple files

Class examples

From time to time, I put the code for class examples in the sub-directory examples
(the older ones are also here on cs, hence the links)

James Larus on Assemblers, Linkers, and SPIM (84 page PDF)

A classic C tutorial

Only note that the syntax for declaring argument types for functions is archaic.

My notes on C

C and mips, side by side

reverse a string.

Summary of Intel assembler instructions, and Floating point coprocessor

Prepared by Lin Jensen, at Bishop's UniversityBishop's Coat of Arms