Welcome to the CSE220 (Systems-Level Programming) home page for Spring 2011. This page will be the main source of course information throughout the semester.
Please check this page regularly for new messages. The newest messages will always appear first.
These are now available under the Personalized Course Information Area.
The exam was graded on a 50-point scale. The highest score achieved was 40. The lowest nonzero score was 11. The statistics are as follows:
In the above, "Valid" means the number of nonzero scores in the applicable category.
printf Solution (HW12):
    
    HW12 submissions were pretty disappointing. Basically, hardly anybody seemed to have the slightest idea of what it means to make a diagram of the activation record format used by GCC and to make a an assembly language function that could be called reliably from C code. Many people did not even show an understanding of what the term "activation record" means. Details will be discussed in recitation, lecture, or both.
      Note:  The "pop the printf arguments off the
      stack as they are printed" idea that some people used will not
      work properly, in general, because upon return from printf
      the stack pointer is not the same as it was at the time of the call.
      You will see a problem if you test with several calls to
      printf in a row, or with a few nested function calls,
      with the call to printf occurring at the lowest level.
      If you had only a simple test with main calling
      printf, you probably didn't see any problem.
    
Moo Solution (HW11):
    
    Notes:
These are now available under the Personalized Course Information Area.
The exam was graded on a 30-point scale. The highest score achieved was 27. The lowest nonzero score was 5. The statistics are as follows:
In the above, "Valid" means the number of nonzero scores in the applicable category.
Printf Solution (HW10):
    
    A few notes:
printf.  If your program didn't have a
	label printf, which was called using
	jal printf, then you didn't satisfy the spec.
	
printf, which presumably everybody has used
	by now.  If your program didn't accept a format string that
	had an arbitrary mixture of ordinary text to be printed
	and conversion specifications (starting with %)
	then you didn't satisfy the spec.
	
a0 and the remaining arguments on
	the stack.  If you passed the arguments to be printed in
	registers, or you limited the number of values that could be
	printed to three or some other number, then you didn't
	satisfy the spec.
	
printf subroutine used any callee-save
	(i.e. "s") registers, then it needed to save and restore
	them, otherwise it won't be properly callable from other code.
	
printf).  You should have
	given some thought to creating a test driver that could
	issue more than one test call.
	
int
	char, and all pointer values, are passed by pushing
	their values directly on the stack (generally in reverse order,
	so that the first or leftmost argument occupies the lowest-numbered
	address).
	Strings are passed by reference, which means that a pointer
	to the string (type char *) is pushed on the stack,
	but the string content (i.e. what the pointer points to)
	is located elsewhere.
	Values of type double are also pushed on the stack,
	but they take two words and consequently have to be aligned
	to an address that is a multiple of 8.  Lots of people missed this,
	and if you had only one test case, you had only a 50/50 chance
	of noticing that the MIPS machine would raise an exception
	when you attempted to load an unaligned double
	value into register $f12 in order to print it.
	
I wasn't sure that I would be able to accomplish this, but I have succeeded in preparing a cross-compilation environment that will allow us to combine C and MIPS assembly components into a single application that can then be run under the MARS simulator. This makes it possible for me to cover substantial amounts of important additional material having to do with how C programs are compiled and linked and the relationship of C to assembly language.
I will probably give as some or all of next week's homework the assignment of downloading the cross-compilation environment that I constructed and getting it set up on your system so that we can do something interesting with it before the end of the semester. However, it would be helpful to me if some hardy souls would like to give this a try sooner rather than later. If so, see here for instructions on getting and using the cross-compilation environment.
A representative of the Stony Brook Computing Society (SBCS) has informed me that they intend to hold a review session for CSE 220 on Wednesday, April 13th at 8:30PM in CS Room 2129. Please note that this is a completely unofficial review session being conducted by SBCS on their own initiative without my participation. I am posting this information in case it may be of benefit to you.
Roll and Checksum Solutions (HW9):
    roll.asm.
      checksum.asm.
	
	Note: The checksum problem basically requires the computation of
	an 8-bit two's complement sum of the sequence of bytes in the
	buffer.  This requires some care with respect to the use of
	signed and unsigned addition.  Notice in my solution that I use
	lbu (unsigned)) to load the data bytes from the
	buffer, and I use addu to accumulate the sum,
	because I don't want an exception to occur on overflow.
	Once all bytes have been summed, I drop all but the low-order
	eight bits of the sum by doing an AND with the mask (0xff).
	Eight-bit two's complement negation is then performed by
	using sub to subtract the result from zero, followed
	by sb to store the low-order eight bits of the result
	in the last byte of the buffer.
	
      The "Visual MIPS" that Saad demonstrated in the recitation
      on Monday, 3/28 originates
      here.
      I cached a copy of the software
      here.
      The .exe file is for systems that already have
      Visual Basic (it worked OK on the Vista system on my laptop).
      The much larger .zip file is for systems that
      don't already have Visual Basic.  I would hesitate to
      attempt installing that, due to possible clashes between the
      DLLs in the ZIP file and possibly newer DLLs already on
      your system.
     
Apparently I am somewhat out of practice at producing portable C code. I updated the test driver so that it compiles cleanly with the -Wall compiler option. This should forestall some possible problems for people running on 64-bit platforms. Please download another version if the one you have is dated earlier than March 22, 1:38AM.
The TA has told me that people were asking if the midterm exams themselves were going to be returned to you. I do not intend to return the exams, because I do not want at this time to "publish" the set of questions. This is because multiple choice tests take a substantial amount of "up-front" time to create, and consequently I want to preserve my options to possibly re-use some of the questions in the future. However, I am happy to go over your exam results with you in my office if you have any questions about what you missed.
These are now available under the Personalized Course Information Area.
The exam was graded on a 40-point scale. The highest score achieved was 36. The lowest nonzero score was 11. The statistics are as follows:
In the above, "Valid" means the number of nonzero scores in the applicable category.
A representative of the Stony Brook Computing Society (SBCS) has informed me that they intend to hold a review session for CSE 220 tonight (Monday, 3/7) in CS Room 2129. Please note that this is a completely unofficial review session being conducted by SBCS on their own initiative without my participation. I am posting this information in case it may be of benefit to you.
Filltext Solution:
    I have posted my solution here.
I am aware of apparent network problems in accessing this Web server. I have not been able to localize the source of the problems. They do not appear to be problems with this machine itself; rather, they are consistent with some kind of externally imposed network lossage or throttle on Web requests. I am continuing to investigate.
I have detected odd network packets arriving at this server. They may be part of some kind of denial-of-service attack, but I haven't understood how they are causing the pauses in web service. I have attempted to firewall the offending packets and we'll see if the situation improves.
The first exam will be held next Tuesday (March 8) during the lecture period. The exam will be in a multiple-choice format, using Scantrons. Bring pencil and USB ID!
UTF8to16 Solution:
    I have posted my solution here.
      Why were there so many people who used fopen?
      The assignment doesn't say to use that, and that's not how
      the Java version works.
      Also, what happened to the concept of good coding style?
      Code should be modular and as easy to read as possible,
      regardless of what language you are writing in.
    
FloatFun Solution:
    
      I heard that people were emailing the TA asking for homework
      solutions.  In general, I feel that the value of this kind of
      exercise lies in your working on them, understanding them, and
      solving them -- canned solutions are probably of little value.
      Nevertheless, since many people seemed to miss the point
      of the FloatFun exercise from Homework 3,
      I have posted my solution here.
    
I have created a newsgroup that can be used to discuss course material. The details are as follows:
bsd7.cs.sunysb.edu
     cse220
     If you send me a question by email and I spend time to answer it, I will likely post the question and answer on the newsgroup, after deleting your identifying information.
Although newsgroups are a relatively old technology, mail readers such as Outlook Express and Mozilla Thunderbird know how to access them. I don't know about Google mail, since I have never used that. Right now there is no authentication required to access the group (primarily because I never got authentication working again the last time I updated the software on my office machine). If there ends up being any problem with the open access I will either have to figure out how to enable authentication or shut it down.
If you don't have a mail reader that knows newsgroups (unlikely), or you can't figure out how to do it (you should try), then I've arranged a web link from which the postings will be accessible automatically as they arrive. The items will just appear as numbered links in the folder and you will have click on each one individually to see what is in it, but hey, it's better than nothing.
     In theory, you should be able to post responses directly via the
     NNTP protocol that is used to read them.  In practice, it might
     not be obvious how to do this with your mail reader.  In that case,
     responses can be sent to the following mail alias:
     cse220@bsd7.cs.sunysb.edu.  Once again, anything sent
     to that address will automatically end up on the newsgroup, so
     if spam starts flooding in I will have to change the alias.
     
Can be found here.
Please note that the meeting room for recitation Section 02 (Monday, 11:45AM-12:40PM) has been changed to Psychology A 137.
People have been asking about the homework submission format. I would greatly prefer it if you submit PDF files. I would rather not get Micro$oft Word files. If you want to write your homework on paper and then scan it (if you have a scanner) or photograph it (probably most people have a digital camera of some kind) that is OK. In that case, please submit PDF if you can create it from the image files, otherwise submit JPG. Thanks.
There will not be any recitation on Monday, February 7, 2011. As of this moment (Friday morning, February 4) I have not yet received a TA assignment, so there is not enough time to meet with a TA and get set up for a Monday recitation. Stay tuned...
There will not be any recitation on Monday, January 31, 2011 (the first day of classes). Please attend the first lecture on Tuesday, February 1.
	  
		cse220s11@starkeffect.com
          
     
     If you have problems reaching me, use the address above. Hopefully it will last the whole semester, but if a virus on somebody's PC gives this address to a spam bot, I will have to change it.
I will be using this system to manage assignment handin and distribute grades.