CS-2011 Machine Organization and Assembly Language

D-Term 2012

This course introduces students to the structure and behavior of digital computers at several levels of abstraction. Topics include the functional organization of computer hardware, the functions and operations of assemblers, linkers, and loaders, representations of numbers in computers, basic assembly language instruction sets, addressing modes, and stacks and procedures.

This year, CS-2011 has been completely redesigned from previous terms. A new textbook, Computer Systems: A Programmer’s Perspective, by Bryant and O’Hallaron, will be used. The course will also feature approximately four new laboratory projects, developed and tested by the authors. The machine and assembly language of choice in this course is that of the Intel Pentium (i.e., IA32, with occasional reference to x86-64).

During this course, students will manipulate numeric data at the bit level, debug a program in Pentium machine language, and work on several other lab assignments that expose the inner workings of compiled code.




Goals and Outcomes

Administrative Information

Office Hours

Grading Policy

Late Assignment Policy


The following links are password-protected in accordance with WPI policy regarding the posting of copyright materials on course web sites. When you attempt to access any page of these sections, you will be asked to log in with your regular WPI user ID and password.

Lecture Notes

Laboratory Projects

Lectures for this course will be captured by the WPI Lecture Capture system. You may playback old lectures by visiting the following web address:–


The Lecture Capture system records the voice of the lecturer, all material projected on the screen from the podium, and a live video of the front of the classroom.


CS 2011 assumes knowledge of the C programming language and the ability to debug it. This may be a previous Computer Science course at WPI such as CS-2301, CS-2303, or another programming course, project, or job.

Students who are unfamiliar with C are not likely to be successful in CS-2011. There will not be enough time to “pick it up on the fly.”



CS 2011 has three main components:–

·         Lectures, which introduce and discuss the principle concepts of the course, including the representation of numerical and non-numerical data, machine language encoding of common C constructs, and other topics.

·         Laboratory projects, in which students develop, debug, and/or analyze low-level programs that expose the machine-level representation of data and code. Laboratory assignments are expected to take 1-2 weeks each and will require considerable time and effort outside of the classroom or laboratory.

·         Recitation sessions, during which students can review and work through class material in an interactive setting with the instructors and teaching assistants. This is also an opportunity to get started with laboratory assignments and to clarify basic issues.

There will be four quizzes during the term — three small quizzes and one medium-sized quiz. Collectively, the quizzes will represent approximately 50% of the grade for the course, and the laboratory projects will also represent 50% of the grade for the course.

Principle topics of the course will be:–

·         Introduction: A Tour of Computer Systems, Chapter 1

·         Representing and manipulating information: including fixed-point and floating-point numbers, arrays, and other data structures, Chapter 2

·         Machine-level representation of programs: Chapter 3

·         Optimizing program performance: Chapter 5

·         The Memory Hierarchy: Chapter 6

The four laboratory projects are expected to be:–

·         Datalab: a series of puzzles, each of which is an empty function body that must be completed to implement a specified mathematical function, such as “absolute value.”

·         Bomblab: a binary Linux executable C program comprising six “phases.” In each phase the student must enter a string on stdin. If the entered string is correct, the program proceeds to the next phase. If not, the bomb “explodes” by printing “Boom!!!” It also automatically deducts ½ point from the student’s grade for the lab. The goal is for the student to defuse as many phases as possible. Each student gets a different bomb, so that no two are alike.

·         Bufferlab: a lab in which the student must apply a series of buffer overflow attacks on an executable file. The purpose to develop a detailed understanding of the stack discipline of C-like languages on IA32 processors.

·         PerformanceLab: a detailed exercise to develop an understanding of the performance impact of caches and code optimizations such as blocking and loop unrolling.

Goals and Outcomes:–

·         Understand the relationship between hardware and software on a modern digital computer

·         Convert different types of data into their binary representations

·         Understand how executable programs are represented in machine language and how data are stored on the stack, in arrays, and in other data structures

·         Be able to test and debug programs at the machine language and assembly language level

·         Become intimately familiar with the use of a debugger

·         Explain the fetch-decode-execute cycle in terms of registers, buses, and memory

·         Describe the assembly and linking processes

·         Explain how cache memory and instruction pipelining can improve computer performance



Administrative Information

CS-2011 meets for four one-hour class sessions per week for a seven-week undergraduate term (28 hours).

Time and Place: Mondays, Tuesdays, Thursdays, and Fridays, 9:00 AM — 9:50 AM, Fuller Auditorium (upper), March 12 – May 1, 2012. During the week of the Patriots’ Day holiday, classes will meet only on Tuesday, April 17, and Friday, April 20..

Laboratory/Recitation Sessions: All recitation/laboratory sessions will be held in the computer lab in Salisbury 123. One-hour sessions are scheduled for 8:00 AM, 9:00 AM, 10:00 AM, and 11:00 AM. Unless you have made prior arrangements (for example, trading with another student), you must attend the session for which you are registered. There are not enough seats in the room accommodate students who oversleep and then expect to get into a later session.

Professor: Hugh C. Lauer
Email: <professor’s last name>@cs.wpi.edu
Office hours: (normally) 1 hour after each class; or see chart below; or
            by appointment
Office: Fuller Labs, Room 144

Teaching Assistants:
William Disanto <wrdisanto> in same domain
Shubhendu Trivedi <s_trivedi> in same domain
Office Hours:– see chart below
Office: Fuller A22

Senior Assistants:
Richard Brown <rpb111> in the WPI domain
Daphne Gorman <daphne> in the WPI domain
Austin Noto-Moniz <austinnoto> in the WPI domain
Office Hours:– see chart below
Office: Fuller A22

Randy Bryant and David O’Hallaron, Computer Systems: A Programmer’s Perspective, 2nd edition, Prentice Hall, 2011.

            Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, 2nd edition, Prentice Hall, 1988.

Class e-mail lists: The following two lists are in the domain cs.wpi.edu:–
cs2011-all  — to reach all students, TAs, SAs, and the professor
cs2011-staff — to reach just the TAs, SAs, and the professor

Course web site: http://web.cs.wpi.edu/~cs2011/d12/
In order to comply with copyright regulations, some of the web pages will ask you to log in. Please use your own WPI login ID and password.

Absences: Students needing to be absent from class should notify the professor by e-mail or in person as soon as possible. Likewise, students needing to schedule assignments or presentations around religious holidays, projects, or interview trips should notify the professor at the beginning of the course.

Office hours













Section D04









Section D01










Section D02









Section D03






























































HCL — Hugh C. Lauer
ST — Shubhendu Trivedi
WD — Will Disanto
ANM — Austin Noto-Moniz
DG — Daphne Gorman
RPB — Richard Brown


Grading Policy

Final grades will be computed as follows:

·         Quizzes: 40-45%

·         Laboratory projects: 40-45%

·         Recitation and class participation: 10-20%


Satisfactory completion of laboratory projects is required for passing this course. Good grades on quizzes alone are not a substitute for doing the projects and for attending recitation sessions.

If there are any circumstances that limit or restrict your participation in the class or the completion of assignments, please contact the professor as soon as possible in order to work something out.


There will be three quizzes of approximately 25 minutes in length, plus a final quiz of 50 minutes in length. Please consult the course web site and/or course e-mail list to learn whether a quiz is closed book or open book, closed notes or open notes.

Quiz dates are

March 20

April 3

April 17

May 1

Quiz papers will be handed out as you enter the classroom. If you finish early, please remain quietly in your seats to avoid disturbing your neighbors.

There are no makeup quizzes. Absence from a quiz will be excused for medical or emergency reasons. A note from your doctor or from the Office of Academic Advising will be required. If you must be absent from campus on a quiz day, please arrange with the Professor prior to the absence.

Students with Disabilities

Students with disabilities who believe that they need accommodations in this class are encouraged to contact the Disability Services Office (DSO) as soon as possible to ensure that such accommodations can be implemented in a timely fashion. The DSO is located in Daniels Hall. The Professor must receive requests for accommodations at least one week prior to an exam.

Academic Honesty

Students are strongly encouraged to work together, help each other, reinforce each others’ knowledge, and consult experts and resources outside the course on all topics. Like most professional environments in your future, success depends upon how well you do when you have access to a full array of resources, not how much you remember by rote.

In the course, you may help each other, but you may not copy each other’s work.

Once you and your classmates have worked out a solution to a problem, you must write it up in your own words or code it in your own coding style. Some assignments may be team assignments. For these, it is expected that all team members participate with roughly equal levels of effort. When you put your name on a team submission of an assignment, not only are you testifying that you have fully participated in that assignment, but also your teammates are also testifying that you have fully participated.

For all assignments, the WPI Academic Honesty Policy applies:–


Late Policy and Grace Period

Late laboratory projects will be penalized 20% of the full value of the project for each day late up to three days.

There are two grace days for this course, with a limit of one per lab project. One grace day will be applied automatically to a late project in lieu of the 20% penalty.

No extra credit or makeup programming assignments will be given. If you have special circumstances, contact the Professor at least 24 hours before the assignment is due.

If submitted programming assignment fails to compile, the graders will make a good faith effort to contact the student. The student may fix and resubmit the assignment for a 20% penalty (no grace day). If it is not fixed, the assignment will be graded as zero.