CS 216, System Programming Languages
Comprising low-level "Assembly language", the C language, and the Linux
operating system
Software you might want to put on your own computer for this course.
If this link is not "Current" use the lab list!
These notes are meant to supplement the textbook, with more examples
and explanations. Generally, the note chapters correspond to the book
chapters.
2018 practice midterm
Some C notes, 29 January 2010
Using Macros
in Assembly Language
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.
Assignments
- Assignment 1, binary
arithmetic, due Friday, 26 January 2024
- Assignment 2, Hex arithmetic,
and 2 MIPS instructions, due Friday, 16 February 2024
- Assignment 3, Boolean algebra
and pseudo instructions, due 15 March 2024
Lab instructions:
Weekly lab period of: Due before next lab(For prompt marking, by Tuesday). Start early!
- Lab 1, 18 January addition.a, easy.a
- Lab 2, 25 January math2.a and (math6.a
OR math7.a )
- Lab 3, 1 February loop4.a,
- Lab 4, 8 February MIPS
program loop6.a, and C program minmax.c
- Lab 5, 15 February MIPS program
logic7.a and C program changecase.c.
- Lab 6, 22 February MIPS programs
bits.a and stack2.a
- Lab 7, 29 February MIPS program funct7.a and
C program oddeven.c
- Reading Week --
- Lab 8, 14 March MIPS program recur1.a OR recur3.a recommended if you are having trouble
- Lab 9, 21 March , C program to evaluate
an arithmetic expression, evalprefix.c
- Lab 10, 28 March, MIPS program
calctree.a,
evaluate a binary expression tree, recursively.
- Lab 11, 4 April, C program
to merge two ordered lists, merge.c
- Lab 12, 11 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)
- 2023
- linklist.a - There also are 2 earlier linklist examples.
- 2016
- interesting.c Sum and
average of an array of "interesting" numbers. Beware buffer overflow!
- 2014
- 2013:
- mergsort.c Use your
merge function to recursively sort an array
- bubble.c
Bubble
sort,
with function inorder. You may use the command line to
enter test data
- writever.asm Recursive
function, Feb 26 2013 -- see also previous incarnations in examples
- count4bit.asm Function
calls another, use of the stack Feb 21-26 2013
- 2012:
- 2011:
- getword.asm Function to
get word from a string. March 2011
- notnice.a - First try at a
function to sum nice numbers
- nicer.a - works, but loop
missing
- nice.a - works.March 8, 2011
- turnaround.a Using stack
to turn around a string (and the value of pi) Feb 20, 2009
- iso2utf.c ISO-8859-1 to UTF-8
conversion, in class example Feb 16, 2009
- upper.s - Intel assembly language
to convert string to upper-case
- getToken get tokens (integer or
operator) from a string -- intel assembly example
- bitwise.c -- using the C bitwise
logical operators to change case
- string-copy.c
- command-line-args.c
- variance.a -- variance example,
showing function call and register conventions
- countwds.c, countwds.a -- function to count words,
using a FSM.
- writever.asm -- recursion
example
- polish.a -- evaluate a postfix
(polish) arithmetic expression
- Quicksort and Partition
Only note that the syntax for declaring argument types for functions is
archaic.
reverse a string.
Summary of Intel assembler instructions,
and Floating point coprocessor
Prepared by Lin
Jensen, at Bishop's University