CS 200 Computer Systems Programming I

Credit Hours: 4
Course Coordinator: Su-Hui Chiang
Course Description: Introduction to computer systems from a software perspective. Systems programming using C and assembly language. Basic computer organization. Representation of data. Machine instruction sets and assembly programming, relationship between C code and assembly code, C pointers and structures and their machine-level representation. Linking and loading. Program debugging. Prerequisite: CS 162.
Prerequisites: Two quarters of introductory programming.
Goals: Introduce computer systems from a software perspective. Teach C and assembly language programming and reading skills. Teach basic systems programming skills and tools. Show how to measure and improve program performance based on an understanding of key aspects of machine architecture.

Upon the successful completion of this course students will be able to:

  1. Explain the basic hardware organization of a computer, including the roles of CPU, ALU, registers, buses, memory, caches, and controllers.
  2. Explain the basic phases of program compilation and execution.
  3. Explain the basic facilities provided by an operating system, including processes, virtual memory, and files.
  4. Do arithmetic in hexadecimal, decimal, octal, and binary notation, and convert among these notations.
  5. Explain how signed and unsigned integers are represented and manually simulate arithmetic operations on these representations.
  6. Explain how floating point numbers are represented and manually simulate arithmetic operations on these representations.
  7. Explain how characters are represented.
  8. Describe what is meant by a machine architecture.
  9. Describe the basic architecture for the IA32 family (or similar machine), including the arithmetic/logic instructions, registers, memory model and addressing, and control instructions.
  10. Read and understand the architecture manual for a new machine.
  11. Explain in detail how stack-based subroutine call and return work at machine level.
  12. Describe the assembly language corresponding to C language features, including arithmetic, control flow, arrays, pointers, structures, and function calls.
  13. Explain the linking process under Linux (or similar O/S), including the role and format of object and executable files, relocation, and shared libraries.
  14. Write, compile, debug, and execute C programs involving terminal I/O, command-line arguments, data and function pointers, structures, unions, arrays, and jump tables.
  15. Write, assemble, debug and execute simple assembly language routines.
  16. Read and understand assembler code generated by a compiler.
  17. Debug C and assembler programs using gdb (or similar debugger).
  18. Combine C and assembler code into a single executable.
  19. Use a makefile to organize development of programs with multiple source files.
Textbooks: Computer Systems: A Programmer's Perspective, Bryant and O'Hallaron, Prentice Hall, 2002.
The C Programming Language, 2nd ed., Kernighan and Ritchie, Prentice Hall, 1998.
References: None.
Major Topics: Basic Machine Organization
Representation of Information
Machine-level Programming in C and assembler
Complex data structures and their representation
Linking and Loading
Systems programming tools
Laboratory Exercises: Bit-level manipulation in C code (2 weeks)
Machine code (2 weeks)
Reverse engineering (2 weeks)
Pointer mainpulation in C code (2 weeks)
Debugging (2 weeks)

CAC Category Credits Core Advanced
Data Structures 1.0
Algorithms
Software Design
Computer Architecture 1.5
Programming Languages 1.0

Oral and Written Communications: None.
Social and Ethical Issues: None.
Theoretical Content: Encoding of information in binary form (1 week)
Problem Analysis: Lab and homework problems in programming, reverse engineering, and debugging.
Solution Design: Lab and homework problems in programming.