Assignment 1, due Jan. 28

Part of the homework for 22C:112, Spring 2011
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

On every assignment, write your name legibly as it appears on your University ID and on the class list! Assignments are due at the start of class on the day indicated (usually Friday). Exceptions will be by advance arrangement unless there is what insurance companies call "an act of God" (something outside your control). Homework must be turned in on paper, either in class or in the teaching assistant's mailbox. Never push late work under someone's door!

  1. Background: Consider the concept of transparency, as discussed in the notes for lecture 1.

    Microsoft's first product was a BASIC interpreter for the Altair computer, based on the 8-bit Intel 8080 microprocessor. This BASIC was interpreted. That is, BASIC programs were executed by a program that read and interpreted the source code directly, without first translating to machine code. Altair BASIC had a pair of commands, PEEK and POKE. These allowed a program to peek at the value in a RAM address or poke a new value into an address.

    A Question: Explain the role of PEEK and POKE in the transparency or opacity of the virtual machine interface provided by Altair BASIC. (0.5 points)

  2. Background: Take a look at the Unix History Web Site http://www.bell-labs.com/history/unix/ to answer the following quick questions (0.2 points each):

    a) What organizations did Bell Labs partner with to develop the Multics operating system?
    b) What was the application program from which the first version of Unix grew?
    c) What was the first high-level language used to implement parts of Unix?
    d) How did the University of California at Berkely get involved?
    e) Who owns Unix today?

  3. Background: Note the following manual of style for C programmers: http://homepage.cs.uiowa.edu/~dwjones/syssoft/style.html and note that the following C program does not conform to this style:
    #include <stdio.h>
    int fib(int i){if(i
    <= 1){return i;}else
    return fib(i-1)+fib(i
    -2);}int main(){int i;
    for( i=0 ;i<= 10;i ++){
    printf("fib(%d)=%d\n",i,
    fib(i));}}
    

    a) Fix it to conform with the recommended style. Running the result is a good way to make sure you didn't break it, but grading will depend on style as well as correctness. (1.0 points)

    c) Would rewriting this program to take advantage of the object-oriented features Java or C# make it any clearer? (0.5 points)