CS2160 (Fall 2011)

Computer Organization and Assembly Language Programming

Quick Info

Computer Organization and Assembly Language Programming
Brian Parks (bparks AT vast DOT uccs DOT edu)
Office: ENGR 176 ("CS Graduate Students") or ENGR 148 (inside ENGR 149, VAST Lab)
Office Hours: TR 3:00 - 4:00 PM (after class) in ENGR 176 or by appointment
Syllabus: (
Emailed files should be named using the following syntax (all lowercase):


About the course

The course catalog has the following to say about this course:

Provides an introduction to the concepts of computer architecture, functional logic, design and computer arithmetic. It presents material on the mechanics of information transfer and control within a computer system. Also included are symbolic programming techniques, implementing high level control structures, addressing modes and their relation to arrays, subprograms, parameters, linkage to high level languages and the assembly process. Prer., C S 1450 and C S 2060.



  1. Homework #1: (pdf) due 30 August.
  2. Homework #2: Exercises C.5, C.6, C.7, C.8 due 8 September.
  3. Homework #3: Find the issue in the C file. (1) Write short description of why it's an issue. (2) Submit a fixed version. Submit by email, with "CS2160 HW3" in the subject. Text is preferable. DO NOT SUBMIT A WORD DOCUMENT. Due 13 September.
  4. Homework #4: Write a MIPS Assembly program that calls a procedure to prompt the user for their name and retrieve the string, then prints "Hello, name." Email as before with "CS2160 HW4" in the subject. Due 20 September.
  5. Homework #5: Exercises 1.3.1-3 and 1.4.1-5 (pp. 59, 60) due 27 September.
  6. Homework #6: Implement Selection Sort in MIPS (convert from C). Due 4 October.
  7. Homework #7: implement the multiplication algorithm discussed in class and in Chapter 3 in C. Assume two decimal numbers will be provided as arguments on the command line and print ONLY the answer. Do not use the multiplication (*) operator. Use only bitshifts and addition (Hint: atoi() may be useful). Due October 27 at the beginning of class. Late submissions will not be accepted.
  8. Homework #8: Convert the division algorithm C implementation to MIPS. For now, test with hard-coded numbers. More details on how I will test the program will come Tuesday. Use command line arguments like in the updated multiplication MIPS and as discussed in lecture for the dividend and divisor. Due November 3 at the beginning of class. Late submissions will not be accepted.
  9. Homework #9: Extend the atoi MIPS implementation to account for floating point (essentially, implement a stripped-down version of atof()). Program should take a single command-line argument, convert it to a floating-point representation in one of the "f" registers, and print it out using syscall 2 (print float). Program should be able to handle numbers like "3.14159" and "2.71828". Program should not attempt to process scientific notation. Submit as an attachment named appropriately. Due 10 November at midnight. Program will not be discussed in class.
  10. Homework #10: Written. Due 22 November at the beginning of class in hard copy. Follow instructions from class 15 November, also posted here.
  11. Homework #11: Identify opportunities to optimize MSIL in this code. Hard copy due 29 November at the beginning of class.
  12. Homework #12: Instructions. Due at class time 8 December.


Dr. Shub's web site for this course from Spring 2011

80386 Programmer's Manual

GCC Inline Assembly HOWTO

Intel 64 and IA-32 Architectures Software Developer's Manuals

PowerPC Manual

MIPS SYSCALL functions available in MARS

Documentation for Microsoft Internediate Language (MSIL)