Assignment 1, due Aug 30

Part of the homework for 22C:116, fall 2002
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due on Fridays at the start of class, and unless there is what insurance companies call "an act of God", the only exceptions to this rule will be by advance arrangement.

  1. What is your E-mail address? (If you have more than one, give the address you'd prefer used for class purposes.)

  2. What operating system or systems were used for programming assignments in your previous operating system courses. For this purpose, count as an operating system course any course where you worked directly with the facilities of an operating system kernel, without the protecting cloak of middleware such as the standard Java, C or C++ libraries -- these are, after all, tools designed to protect you from having to learn about operating systems.

  3. What computer architecture or architectures were the focus of your previous computer hardware courses. For this purpose, count as hardware courses any courses where you had to either program in assembly language, write software to generate code in machine language, or study the construction of hardware or software to execute a machine language. Please indicate which of the above you have done with each such machine architecture you have used.

  4. Background: Consider an object O of class C, where M is a method of O and P is a parameter to the method M. The class C has several subclasses, each with its own implementation of M. A call to method M of object O passing parameter P would be written as follows in a typical object-oriented programming language:
          O.M(P)
    
    There are several well-known approaches to implementing polymorphic objects; The fastest stores, in each object, pointers to the code of the polymorphic methods of that object's class. Objects with many polymorphic methods are therefore large. To minimize the object size, we can store, in each object, a pointer to the descriptor for the object's class, and store pointers to all of the polymorphic methods in the class descriptor.

    Problem: Give code or pseudocode at the machine language level for the example call given above. Use the machine architecture you know best, or alternatively, give code in C (not C++) instead of machine code or machine-level pseudocode.

    Pseudocode, by the way, gives details about some computation with an informal disregard for syntactic formality.

  5. Background Function calls are typically implemented by an instruction or an instruction sequence (the calling sequence) that pushes certain information on the stack. Calls to interrupt handlers typically begin with the hardware's interrupt transfer mechanism followed by some instructions to push certain information on the stack.

    The Question What is the difference between the information pushed on the stack by a typical function call and by response to a typical interrupt.