CMSC 212
Introduction to Low-Level Programming Concepts
Spring 2006
May 24
See the important end-of-course announcements!
May 13
A small correction was made to the PowerPea Assembly Function Call Example; the stack pointer offsets for the parameters to parse_args() should be negative, because the arguments to parse_args() are placed below the stack frame for main(), in lower memory addresses.
May 12
I originally planned on having extra office hours before the final exam, but I will not be able to be on campus Sunday through Thursday. I will hold my regular office hours this afternoon, and I will have office hours Saturday 1:00-3:00. Someone else will be proctoring the final exam. I should be back on campus starting on Wednesday; if anyone needs to contact me about anything after Saturday then try then.

Some other various end-of-semester announcements will be put here in a few days, so check back.

The Exam #2 average and standard deviation should be on the grade server. The other information is:
90s: 7
80s: 16
70s: 31
60s; 18
< 60: 9

>= 82: A
75-81: B
63-75: C
< 63 D/F

May 11
You may find these notes outlining the main topics of the course helpful in studying for the final. They are not pretty; they are not exhaustive; they are not any indication of what may or may not be on the final exam.
May 10
The release tests are available; see the description at the usual place.
May 9
We're trying to put the release tests on the submit server, but everyone's project fails to compile because no one's submission contains a file tester.c. Unfortunately, due to the way the submit server works, it has to be able to build your program for all of the public tests and release test and secret tests before it can do anything with your program. So even though your program may work fine for the public tests, if it doesn't build something for the as-yet-nonexistent release tests, it won't compile at all. Solution- we just put a new tarfile in the class-files directory, with a tester.c which just has an empty main program. Just untar it and submit again, including that tester.c in your submission.
We won't be able to put the release tests on the submit server until tomorrow morning, because no one's project currently compiles, but they are ready to go and we will put them there tomorrow morning.

One new Project #5 clarification is at the usual place.

The void pointer example void-pointer.c has been fixed. The arrays should have been arrays of void *, just like the pointers in your data structures in the project are void * so they can store different types of data (either by casting the data to a pointer, if the data is no larger than a pointer, or if data is larger than a pointer and can't be cast to a pointer, then the arrays can point to the data which has been dynamically allocated).
May 8
See the Project #5 corrections and clarifications here. Be sure to check periodically for updates.
May 7
Larry's office hours on Monday will be covered by Jose.

The void-pointer.c example is not very portable, as an array of int or char and void * may not be the same sizes on different platforms. Until it can be revised in a clear manner, it'll work on the Solaris Grace hosts if you want to run it. Sorry for any confusion, but the main point of the example, which is passing values by casting to void * is the same in any case, and the same issue doesn't come up in your project since you don't ever have to create arrays of void *.

Please copy the Project #5 tarfile again. It contains new public test files public01.c and public02.c. The previous ones work fine, except if your main.x has an error no error message would show up, which of course could be confusing. The new versions use execl to run main.x, rather than system.
May 6
  • One small additional change which was just made in the Project #5 Makefile, which you just can make yourself in your own copy, was to add -fPIC to CFLAGS in the second line.

  • The Project #5 tarfile has been updated with two public tests, which have been put on the submit server. The public tests just call main.x once with the -bst command-line argument, and once with the -heap command-line argument, both times redirecting the input from the same file "numbers" previously provided. The public tests are worth 35 points.

  • A couple of mistakes have been corrected in table.h in the new tarfile, so be sure to extract the files and use the updated header file.

  • The file main.c has been renamed in the new tarfile as main-int.c, and the Makefile has been adjusted accordingly. This will allow you to create the original progam now named main-int.x, which just uses bst-int.c, while at the same time as you can create main.x using your bst.c or heap.c. Note that the two public tests should produce exactly the same output, which is exactly the same output as produced by running the original program main-int.x.

  • To compare the results of two programs just redirect their output to two files, and run the UNIX utility diff on them, e.g., diff file1 file2. If the files are identical diff will produce no output. If diff produces some output it is indicating the differences between the files.

  • We've noticed some confusion in the following: some people think that when the term "void * pointer" is used, it automatically means that something is being dynamically allocated. It's not a necessity that the data being stored in your table must be dynamically allocated. To illustrate the use of void * pointers used to pass parameters which aren't dynamically allocated, an example program void-pointer.c has been placed in the class-files directory, which you may want to look at. Of course, your table should be able to be used to store dynamically-allocated data as well (if it's being used to store data which can't be cast to void *), in which case the client or application program using your table would dynamically allocate data and insert it into the table by passing a pointer to it.
April 22
Some expressions in the 4th and 5th public tests were calling simplify on expressions which aren't defined to have a value. The proect assignment didn't specify clearly what simplify should do in such a case. So your program can produce any resuls for those cases, and to allow that we just removed those expressions from the 4th and 5th public tests. So if you were getting wrong results on those inputs, check the submit server again- your results could be right now. Of course, if your results were right before then they will still be right now.
April 20
Five release tests (20 points) are now on the submit server. They may not show up in your results for an hour or so.

Saeed improved the expression reader so it gives better error messages if it tries to read incorrect expressions. This may save a time and effort when running your own tests. So please copy the new expression-reader.o file which was created around 6:00 today.

When the submir server was cutting off the end of the results yesterday we reversed the order of your output and the correct output in the results, so you could see all of the correct output. Now that the server's apparently working right again, we'll switch these back. So even though it'll be switching twice in two days, be careful not to mix up which part of the output is your output versus the correct output.

The README file for the expression reader says "The AST reader works by calling your functions create_int_constant_node, create_double_constant_node, create_variable_node, and create_operator_node. If you haven't written these functions or they have problems, the expression reader won't work. So first write and test those functions by hand before trying to use the expression reader" (or before trying to run your program on the public tests).

The submit server appears to be truncating the end of the results at times (the "long result" column under your test results). This has been reported; so there's no need to email the instructional staff about it. This is an inconvenient situation but there isn't anything we can do about it besides report it. However, you should be able to at least view the correct output on the submit server, and you can run the public tests yourself to see your output, and just compare these.
April 19
Note: the original announcement about the expression reader described it as being optional, which it is for your own tests (although using it is highly recommended), but because it would have been very inconvenient to create all of the public tests by hand, they were written using the expression reader. Therefore you'll have to copy expression-reader.o to your directory, and extract the files in the tarfile again, to get the public tests to compile.
April 18
A small bug in the output to one of the public tests was corrected; sorry for any confusion.

If you submitted the project yesterday the submit server may have reported incorrect results for it. Please check your results on the submit server again now.
April 17
Five Project #4 public tests have been set up on the submit server, at 10 points each, so the maximum score possible is currently 50 points.

To facilitate testing your functions, Saeed has written an expression reader which can be used to easily construct and return the AST corresponding to an input expression; you can use the AST returned to call your various functions with. See the README file in the directory class-files/project4-expression-reader.

A small but important bug was corrected in the expression reader at 5:00 today- if you had already copied the files before that, just copy them again.
April 16
A couple of Project #4 clarifications were added today.

Lecture slides from this past week are posted.
April 14
Another Project #4 correction today.
April 13
See the Project #4 corrections and clarifications here. Be sure to check periodically for updates.
April 4
Be sure to see today's batch of project clarifications (so far). Check the clarifications every time you log in.

The lcov example was moved to the directory lecture18-examples, and the fork example was changed slightly to illustrate a point brought up in lecture.
April 3
Note: on UNIX and Linux you do not break a program which has an infinite loop using control-z like you do in DOS or at the Windows command prompt. In UNIX and Linux, control-z runs a program in the background, where it continues to use up CPU cycles and slows the machine down for all other users. Like the posted UNIX tutorial says, in UNIX and Linux control-c is used to break a running program.
April 2
The names of the public tests have been changed, for example from public1,c to public01.c, etc. (this is because there are more than nine release and secret tests). Either remove the public*.c test files from your directory before submitting, or copy the new tarfile and extract the files again.

The Project #3 public tests have been changed to 45 points (9 points apeice). Ten release tests (20 points) are now on the submit server. The secret tests for this project will be worth 20 points.
March 30
Five Project #3 public tests (50 points) are now set up on the submit server, and the project tarfile has been updated to include the five test programs and the associated Makefile.

Release tests will be available in a couple of days.
March 28
The Project #1 release and secret test programs are now in the directory class-files/project1-tests on Grace.
March 27
See any important Project #3 corrections and clarifications here. Be sure to check periodically for updates.
March 15
Eight release tests are now available on the submit server. The release tests are 18 points, so the maximum score is now 68. You have 5 release tokens for this project, instead of 3. Each release token regenerates in 24 hours.
March 15
Example linked list code is on grace in class-files/discussion/list/.
March 13
  • The error ERRINVADR should only be returned if the Powerpea program actually tries to reference memory at an invalid address. If some instruction contains an invalid address but it isn't executed or doesn't ever try to access that location, it's not incorrect.
  • See a few important Project #2 corrections and clarifications here.
  • John forgot to return the graded Project #1 source code results in section 0201 today, so I'll hand them back in lecture tomorrow.
  • If you're using the assembler, copy the file assembler.o again. It's just been updated so that all unused fields of instructions are zeroed out. This just makes it easier for you to understand the results.
  • The Project #1 results should now be visible on the submit server.
March 12
  • The Project #2 project2.tgz tarfile has been updated again to add #include "machine.h" to interpreter.h. The submit server takes a while to update, but it will be updated as well with this change.
  • The public tests have been set up on the submit server. The public tests are worth 50 points. Be sure to check your results on the public tests. Some release tests will be set up soon.
  • The Project #2 project2.tgz tarfile has been updated to add #ifndef/#define/#endif to machine.h and interpreter.h, which could be important when using the assembler. Although these changes are minor, get the files from the current project2.tgz to make sure your program works with them.
March 11
The Project #2 project2.tgz tarfile has been updated to include four public tests. Now that there are public tests, it has also been possible to include a Makefile in the tarfile.

The public tests will be set up on the submit server soon; watch this space to see when. A few clarifications and corrections to the Project #2 assignment will also be placed here shortly.

The assembler, which you can use to create tests for your interpreter, has also now been placed in the directory class-files/project2-assembler. A README file in that directory gives a brief explanation, and there are two examples in the directory demonstrating the use of the assembler as well.
March 7 Final exam time
As you know from the syllabus, the final exam time in the Schedule of Classes originally listed for this course was wrong, and the correct final time wasn't going to be available until partway through the semester. The Scheduling office has now given us a final exam time, which is Monday, May 15, 4:00-6:00 pm
March 3
The practice exam is on the Exams page.

In addition to the readings given during class, which were Chapters 1-9, Sections 10.1-10.2, Chapters 11, 12, 14, and 15, it would be useful to read Section 10.4, which is only three pages, and which was omitted inadvertently before.
February 27
Note that each release token regenerates after 24 hours, so if you've used your release tokens on one day you'll have more to use again the next day.
February 24
The submit server will be down for an hour around midnight tonight (Friday, February 24). If you try to use it around that time and it's not working, just try again in an hour.
February 19
See the important Project #1 corrections and clarifications here.
February 15
Solutions to this week's discussion exercises from Monday are now on the Discussion material page. Note that this is a compressed tarfile, so download it and transfer it to any directory in your Glue account you like (although it's recommended you use a directory in your extra course disk space), and extract its contents using the UNIX command gtar -zxvf   name-of-tarfile
February 10 Office hours
As discussed in lecture the office hours schedule will be given out next week in class, but in the meantime here are the office hours between now and then. All office hours are held in AVW 1112 except Larry's, which are in AVW 1111.

Friday 10:00-11:00 John
Friday 12:00-1:00 Jessica
Friday 2:00-3:30 Jose
Friday 3:30-5:00 Larry

Monday 10:15-12:45 Jose
Monday 12:45-1:45 Jessica
Monday 2:00-3:30 Larry
Monday 3:30-5:30 Elena

Tuesday 11:00-1:00 Saeed
Tuesday 1:00-3:00 Kai
Tuesday 3:00-4:00 Shomir
Tuesday 4:00-5:30 Larry
January 26
If you don't have one, apply for a Glue account here right away!
January 26
Welcome to CMSC 212!
Staff Name Office (A.V. Williams) Office hours
instructor Larry Herman 1111, x52762 M 1:30-3:00, Tu 4:00-5:30, F 3:30-5:00
teaching TA- 0101 & 0102 Elena Zheleva 1112 M & W 3:00-5:00
teaching TA- 0201 John Kleint 1112 F 10:00-12:00
teaching TA- 0202 Shomir Wilson 1112 Tu 3:00-4:00, Th 2:00-3:00
grading TA Saeed Alaei 1112 Tu & Th 11:00-1:00
grading TA Jose Troche 1112 M 10:15-12:45, F 2:00-3:30
grading TA Kai Zhang 1112 Tu 1:00-3:00
undergraduate TA Jessica Chang 1112 M 12:45-1:45, W 11:00-1:30, Th 3:30-5:30, F 12:00-1:00