CSC 548: Homework 3

Deadline: 5.30pm, Thursday April 22 2004.

Homework

Download the updated compiler archive for this course, and make sure you can compile and run the compiler:

  ant test

Currently the tests fail because tail call optimization isn't implemented yet, for example:

Testcase: .../test/ok/TestFactorial02.hob took 0.039 sec
	Caused an ERROR
null
At line 25
    call Factorial$factTR is not 
    jmp TC$Factorial$factTR

Load up the file hobbes/ia32/CodeGen.java into your favourite editor, and start editing!

Your job is to complete the code generator so that when you run the compiler it doesn't report any errors.

Submit your modified CodeGen.java file to the Courses On Line system.

Reading

Appel, Chapter 11.