CS611
Programming Assignment 3
Spring 1997


Complete the function arithOpHandler (in the file op_arith.C) and the function controlOpHandler (in the file op_control.C) for the UNH implementation of the Java Virtual Machine known as java611.

The directory ~cs611/public/prog3 contains stubs for the two functions, as well as a Makefile, README files, and the relevant java611 header files.

The Makefile, to save on your disk quota, links with a large object file stored in ~cs611/public/stub3 and builds the executable in /usr/tmp. The Makefile also stores a "link" to the executable in your default directory so this "non-local" build should be transparent to you.

The README files describe how to use java611. You will likely find the "trace" and "debug" features of java611 useful when debugging this assignment.

The distributed header files document the necessary parts of java611 that you will need to use to complete this assignment. The two key components you will need to use are frame objects and operation objects.

Your program will be graded primarily by testing it for correct functionality. The two functions you are to complete encompass 51 Java Virtual Machine opcodes. Each opcode will be worth 4 points. Therefore, although grades will be assigned on a basis of 100 points, you can theoretically obtain 104 points.

However, you may lose points if your program is not properly structured or adequately documented. The same general guidelines given on program 2 are still in effect.

To understand the details of individual opcodes you must implement, you will want to consult the The Java Virtual Machine Specification by Lindholm and Yellin. Remember this book is on reserve in the Kingsbury library. Also on-line versions of early drafts of the book have been found at various exotic places: here, here, and here. The draft version of the document should be sufficient to do this assignment.

Java test programs will be distributed in ~cs611/public/test3. Only the distributed test cases will be used for grading this assignment.

The executable for the full implementation of java611 is available in ~cs611/bin/java611. This executable is for use on Alpha machines. To execute the test programs you first compile them with the Java compiler: on hopper/christa: /usr/local/java/bin/javac. And then you can execute them with java611 or with the official Java virtual machine implementation: on hopper/christa /usr/local/java/bin/java. To test with your code you execute the version of java611 that you build by invoking the distributed Makefile.

Since the rest of java611 is written in C++, it makes sense to do this assignment in C++. Students with little or no prior C++ experience should have joined Mark's help group to alleviate difficulties using C++. The number of C++ features that you need are really quite few.

Your programs will be graded using an Alpha machine (e.g. hopper and christa) so be sure to test in that environment. In fact, java611 is not guaranteed to work in any environment other than the Alpha.

Your programs should be submitted for grading from either hopper or christa. To turn in this assignment, type:
~cs611/bin/submit prog3 op_arith.C op_control.C

Notes:

Submissions can be checked by typing:
~cs611/bin/scheck prog3

To receive full credit for the assignment, you must turn in your files prior to 8am on Monday March 10. Late submissions will be accepted at the penalty of 5% per day up to one week late.

Remember: as always you are expected to do your own work on this assignment.


Last modified on February 21, 1997.

Comments and questions should be directed to pjh@cs.unh.edu