Princeton University
Computer Science Department

Computer Science 217
Introduction to Programming Systems

Kai Li

Spring 2004


Directory
General Information | Schedule | Assignments | Announcements | Policies

Week 1: 2/2 - 2/8

Reading (required):  King (C Programming) 2, 3, 10; Kernighan & Pike (Practice of Programming) 1

Reading (recommended):  Kernighan & Ritchie (The C Programming Language) 1; Loukides & Oram (Programming with GNU Software) 2,  3,  4

Lecture 1: (Monday) Introduction and basics of C

Precept 1: (Monday/Tuesday) Introduction; The Program Preparation Process

Lecture 2: (Wednesday) Programming style and scope

Precept 2: (Wednesday/Thursday) UNIX; Emacs


Week 2: 2/9 - 2/15

Reading (required): Kernighan & Pike (Practice of Programming) 4; King (C Programming) 4, 5, 6, 7, 8, 9

Reading (recommended): Kernighan & Ritchie (The C Programming Language) 5; Loukides & Oram (Programming with GNU Software) 6

Lecture 3: (Monday) Modules and interfaces

Precept 3: (Monday/Tuesday) C Simple Programs; C Fundamentals

Lecture 4: (Wednesday) Pointers and arrays

Precept 4: (Wednesday/Thursday) C Multi-File Programs; Gdb

(Sunday) De-Comment Assignment Due


Week 3: 2/16 - 2/22

Reading (required): King (C Programming) 11, 12, 13, 14, 15, 16,

Reading (recommended): Kernighan & Ritchie (The C Programming Language) 4.11

Lecture 5: (Monday) Abstract data types

Precept 5: (Monday/Tuesday) C Pointers; C Arrays

Lecture 6: (Wednesday) Preprocessing and Macros

Precept 6: (Wednesday/Thursday) C Strings; C Constants

(Sunday) MyString Module Assignment Due


Week 4: 2/23 - 2/29

Reading (required): Kernighan & Pike (Practice of Programming) 2, 5; King (C Programming) 17.1-6, 19.1-3

Reading (recommended): Loukides & Oram (Programming with GNU Software) 9; Hanson (C interfaces and implementations) 3.2

Lecture 7: (Monday) Program design and hash table

Precept 7: (Monday/Tuesday) C Files; C Structures; C Dynamic Memory Management

Lecture 8: (Wednesday) Robust programming and debugging

Precept 8: (Wednesday/Thursday) C Abstract Data Types


Week 5: 3/1 - 3/7

Reading (required): Kernighan & Pike (Practice of Programming) 6; King (C Programming) 17.7

Lecture 9: (Monday) Testing and profiling

Precept 9: (Monday/Tuesday) C Void Pointers and Abstract Data Types; The Symbol Table Assignment

Lecture 10: (Wednesday) Dynamic memory allocation

Precept 10: (Wednesday/Thursday) C Function Pointers and Abstract Data Types; A DynArray ADT

(Sunday) Symbol Table Assignment Due


Week 6: 3/8 - 3/14

Reading (required): IA32 Intel Architecture Software Developer's Manual, (Volume 1: Basic Architecture) 4; Bartlett (Programming from the Ground Up) 1, 2; King (C Programming) 18

Reading (recommended): Loukides & Oram (Programming with GNU Software) 7;  IA32 Intel Architecture Software Developer's Manual, (Volume 1: Basic Architecture) 3;

Lecture 11: (Monday) More on allocation and Overview of  architecture

Precept 11: (Monday/Tuesday) C Declarations and Definitions; Exam Preparation

Lecture 12: (Wednesday)  Midterm Examination (Old exams and answer sheets)

Precept 12: (Wednesday/Thursday) Make


Week 7: 3/15 - 3/21

(Monday - Sunday) Spring Recess


Week 8: 3/22 - 3/28

Reading (required): Bartlett (Programming from the Ground Up) 3, 10, B, E

Reading (recommended): Using as, the GNU Assembler; IA32 Intel Architecture Software Developer's Manual, Volume 1: Basic Architecture 2.1, 3, 4.1-4.2, 5

Lecture 13: (Monday) IA32 instructions

Precept 13: (Monday/Tuesday) Assembly Language: Getting Started

Lecture 14: (Wednesday) Floating-point, branching and assembler directives

Precept 14: (Wednesday/Thursday) Assembly Language: Fundamentals


Week 9: 3/29 - 4/4

Reading (required): Bartlett (Programming from the Ground Up) 4, 9, F

Reading (recommended): Bartlett (Programming from the Ground Up) 5, 6, 7, 8, 11, 12, 13, C; Executable and Linkable Format

Lecture 15: (Monday) Procedure calls and calling conventions

Precept 15: (Monday/Tuesday) Assembly Language: Control Transfer, Instruction Operand Types

Lecture 16: (Wednesday) Assembler and Linker

Precept 16: (Wednesday/Thursday) Assembly Language: Local Variables, Functions, Gdb

(Sunday) UNIX Commands in Assembly Language Assignment Due


Week 10: 4/5 - 4/11

Reading (required): Kernighan & Pike (Unix Programming Environment) 7.5; King (C Programming) 24.3

Reading (recommended): Kernighan & Pike (Unix Programming Environment) 1, 2, 3, 4, 5; Loukides & Oram (Programming with GNU Software) 9

Lecture 17: (Monday) Overview of operating system

Precept 17: (Monday/Tuesday) Assemblers and Linkers

Lecture 18: (Wednesday) Signals and alarms

Precept 18: (Wednesday/Thursday) Gprof; The Execution Profiler Assignment (Part 1)


Week 11: 4/12 - 4/18

Reading (required): Kernighan & Pike (Unix Programming Environment) 7.4

Reading (recommended): Kernighan & Pike (Unix Programming Environment) 7.1-3

Lecture 19: (Monday) Exceptions

Precept 19: (Monday/Tuesday) UNIX Signals and Alarms

Lecture 20: (Wednesday) Processes

Precept 20: (Wednesday/Thursday) The Execution Profiler Assignment (Part 2)

(Sunday) Execution Profiler Assignment Due


Week 12: 4/19 - 4/25

Lecture 21: (Monday) Interprocess communication

Precept 21: (Monday/Tuesday) Abstract Objects; The Shell Assignment: Overview

Lecture 22: (Wednesday) Interprocess communication, cont'd

Precept 22: (Wednesday/Thursday) The Shell Assignment: UNIX Processes


Week 13: 4/26 - 5/2

Reading (required): Kernighan & Pike (The Practice of Programming) 7, 8

Lecture 23: (Monday) Portable programming

Precept 23: (Monday/Tuesday) The Shell Assignment: UNIX Low-Level I/O

Lecture 24: (Wednesday) Performance tuning

Precept 24: (Wednesday/Thursday) The Shell Assignment: UNIX Inter-Process Communication


Week 14: 5/3 - 5/9

(Monday - Sunday) Reading Period


Week 15: 5/10 - 5/16

(Monday) Reading Period

(Tuesday) Dean's Date

(Tuesday) Shell Assignment Due


Week 16: 5/20

(Tuesday) Exam Preparation

(Thursday) Final Examinations: Room 104, 1:30-3:30pm. (Old exams and answer sheets)


All lecture notes are copyright 2001, 2002, 2003, 2004 by Kai Li, Andrew W. Appel, Thomas Funkhouser, David R. Hanson, Larry Peterson, and/or Randolph Wang. All precept handouts are copyright 2001, 2002, 2003, 2004 by Robert M. Dondero, Jr.  Permission to reproduce these notes for not-for-profit educational purposes is hereby granted. These notes may not be reproduced for commercial purposes without the express written consent of the author.