CS520
Assembly Language Programming and Machine Organization
Fall 2010


Instructor: P. Hatcher
Office: Kingsbury N229/N221D
Phone: 862-2678
E-mail: hatcher@unh.edu
Office Hours: Mon/Wed 9:00-9:40am and 11:00-11:30am; Fri 11:00-11:30am; or by appointment (send e-mail to request an appointment).

The prerequisite for this course is CS515.

The key goals for the course are to understand program and data representation, to become familiar with assembly language, machine language and C programming, to understand the impact on software of basic computer architecture concepts such as the memory hierarchy, and to study fundamental system software such as assemblers and linkers.

I was kind of freaked out when I realized that there are people graduating with CS degrees who'd never written C. They started in Java and they stayed there. That just seemed bizarre and wrong. —Jamie Zawinski, early Netscape/Mozilla developer, quoted in Coders at Work by Peter Seibel.

I see people that are really smart—I would say they're good programmers—but say they only know Java. The way they think about solving things is always within the space they know. They don't think end-to-end as much. I think it is really important to know the whole stack even if you don't operate within the whole stack. … In practice, nothing works. There are all these beautiful abstractions that are backed by sh*t. The implementation of libraries that look like they could be beautiful are sh*t. And so if you're the one responsible for the cost of buying servers, or reliability—if you're on call for pages—it helps to actually know what's going on under the covers and not trust everyone else's libraries, and code, and interfaces. —Brad Fitzpatrick, creator of Livejournal, quoted in Coders at Work by Peter Seibel.

The University is committed to providing students with documented disabilities equal access to all university programs and facilities. If you think you have a disability requiring accommodations, you must register with Disability Services for Students (DSS). Contact DSS at (603) 862-2607 or visit them in MUB 118. If you have received Accommodation Letters for this course from DSS, please provide me with that information privately so that we can review those accommodations.

Tentative Schedule

  1. week of August 30

  2. week of September 6

  3. week of September 13

  4. week of September 20

  5. week of September 27

  6. week of October 4

  7. week of October 11

  8. week of October 18

  9. week of October 25

  10. week of November 1

  11. week of November 8

  12. week of November 15

  13. week of November 22

  14. week of November 29

  15. week of December 6

  16. week of December 13

Readings

The readings given in the above schedule are recommended but not required. They are intended to be supplementary to the lectures. Everything you need to know for an assignment or an exam will be covered in lecture or laboratory. However, the readings will provide a second presentation of most of the material for the course, in case you find things confusing. For most people, seeing the material twice is very helpful.

Grading

Course grades will be assigned in the following manner:

Laboratory grades will be based upon attendance and effort. All laboratories are based upon the current programming assignment. Each programming assignment, except Program 4, will have two labs.

The purpose of the first lab is to help you get started on the assignment. At the end of this lab you will submit your code that you have written so far for the current assignment. Your grade for this lab will largely depend on the effort you make during lab.

The purpose of the second lab is to encourage you to bring nearly finished code to lab for review. At the end of this lab you will submit your code that you have written so far for the current assignment. Your code should be substantially complete. That is, the functionality should be fully implemented, but possibly not fully tested and debugged. The grade assigned for a code review will include both the layout and documentation of the code (see below) and the level of functionality attempted so far.

Laboratory sessions are 50 minutes long and will be held on Fridays in Kingsbury N218.

The programming assignments are (with tentative due dates):

  1. Compressing and decompressing ASCII files: due Sept 12.

  2. Converting IEEE single-precision floating point to/from IEEE double-precision floating point: due Sept 26.

  3. Allocating memory with a conservative garbage collector: due Oct 10.

  4. Implementing an exception-handling mechanism for C programs: due Oct 24.

  5. Implementing a POSIX threads application with a concurrent data structure: due Nov 7.

  6. Implementing an assembler for the vm520 virtual machine: due Nov 21.

  7. Implementing the vm520 virtual machine: due Dec 12.

The programming assignments must be done in C.

Each programming assignment will be worth 100 points. Programming assignments may be handed in late at a penalty of 2 points for one day late, 5 points for two days late, 10 points for three days late, 20 points for four days late, and 40 points for five days late. No program may be turned in more than 5 days late. An assignment is not considered late unless turned in after 8am on the day after the due date.

The grading of programming assignments will be based primarily upon demonstrated correct functionality. That is, you will be awarded points for what your program actually does. Some test cases may be public but others will be hidden, so careful testing will be required.

Points will be deducted from your programming assignment grade if your work is not adequately documented and structured. You must follow the following guidelines:

In addition, lines should not exceed 80 characters when printed using a tabstop width of 8. It is best to not put tabs in your files. Have your editor automatically expand tabs into spaces. It is also best to use a small indentation amount, like 2.

If you have any questions about these rules for program layout, see me in advance, not after your first program review.

The final exam will be comprehensive.

Students receiving at least 65% of the course points are guaranteed at least a C-. Students receiving at least 75% of the course points are guaranteed at least a B-. Students receiving at least 85% of the course points are guaranteed at least an A-.

Textbooks

There is no required textbook for this course.

On reserve in the Kingsbury library:

The purchase of these books is not required, so the local bookstores will not have them. However, if you want your own copy, they are readily available from on-line retailers. (If you obtain the second edition of the Bryant and O'Hallaron book, then the readings given above will be slightly different. See me if you need help translating references to sections of the first edition to sections of the second edition.)

Also you can get on-line access to C references via the UNH library's license for Safari Tech Books. See the website for the Kingsbury Library for more information. Once in Safari, select the Programming category and then select C.

If you are serious about building your software development skills, I heartily recommend Coders at Work: Reflections on the Craft of Programming by Peter Seibel. The book contains interviews with fifteen master programmers.

Computer Accounts

agate.cs.unh.edu is the primary computing resources for this course. You should automatically be given an account on this machine. During the semester you may use any other machines that you have access to, but for grading purposes your programs must execute correctly on agate.cs.unh.edu.

Policy on Cheating

All students are expected to do their own work on all assignments. No collaboration is allowed, either with current or prior CS520 students, or anyone else. One general rule to follow is that you may discuss your programs with other students at the concept level but never at the coding level. If you are at all unclear about this general rule, don't discuss your programs with other students at all.

Note that this "no collaboration" policy does not distinguish between the "giver" and the "taker". I consider both parties equally guilty.

In addition, submitting programs that are based upon code retrieved from Internet sources is also explicitly forbidden and will be considered "cheating".

Be aware that I use tools for automatic plagiarism detection that analyze both current and past assignment submissions.

Because so much of your course grade is based upon the programming assignments, I will treat cases of cheating severely. If caught cheating on an assignment, you can expect to (at least) receive a failing grade for the course.

In addition, of course, collaboration is also not allowed on the midterm exam or the final exam.


Last modified on November 8, 2010.

Comments and questions should be directed to hatcher@unh.edu