Stage 4 of Project
CS 360 - Compiler Design Fall Semester 1996
Due: Wednesday December 11, 1996

  1. References: The Java Virtual Machine Specification by Tim Lindholm and Frank Yellin, Addison Wesley, 1997. Chapters 3, 4, 6 and 7.

  2. Purpose: The purpose of this stage is to generate java assembly code for the language Bisonita.

  3. Introduction: By now you should be convinced that you do not want to compile your postfix intermediate code to java byte code directly. Therefore, we will compile to an intermediate step and use a tool created by someone else to finish the task. We will compile to java assembly code then use a java assembler to create the java byte code usable by the JVM tool java.

  4. Assignment: Your program should convert your intermediate postfix code into java assembly code. The manual for java assembly code is on-line as a Web page for CS360 at URL:

    I have downloaded Jason Hunt's files to the local directory:


    I have created his program javaa in that directory. After you have created your file containing java assembly code, you run his assembler by typing:

        % ~cs360/java-assem/javaa < yourfile.jasm

    javaa creates a .class file which can be run by java.

        % java classname

    See the README file and the two examples in the directory.

  5. NOTE: To shorten the assignment, you do not have to implement function subprograms.

  6. Hand in:

    a). Hand in a listing of each of your intermediate code operations and its associated java assembly code. This can be done by analysis alone without any programming in C++. Remember that we need to distinguish lvalues from rvalues for IDs.

    b). Hand in a listing of your lex and yacc files and runs that convince me that stage 4 works.

    c). Hand in a detailed discussion of what works and what was not completed.

  7. Extra Credit: Implement functions and function calls.

Dr. Daniel C. Hyde
Sun Dec 1 17:16:17 EST 1996