Assignment 7 Extra Code
Extra code_writer.py Methods
# ============= NEW METHODS ======================
def write_init(self):
"""Writes assembly code that effects the VM initialization,
also called bootstrap code. This code must be placed at
the beginning of the output file. """
None
def write_label(self, label):
""""Writes assembly code that effects the label command"""
None
def write_goto(self, label):
"""Writes assembly code that effects the goto command"""
None
def write_if(self, label):
"""Writes assembly code that effects the if-goto command"""
None
def write_call(self, function_name, num_args):
"""Writes assembly code that effects the call command
function_name is a string, num_args an int
"""
None
def write_return(self):
"""Writes assembly code that effects the return command"""
None
def write_function(self, function_name, num_locals):
"""Writes assembly code that effects the function command
function_name is a string, num_locals an int
"""
None
Extra CodeWriter.java Methods
/* ============= NEW METHODS ======================*/
/*
* Writes assembly code that effects the VM initialization,
* also called bootstrap code. This code must be placed at
* the beginning of the output file.
*/
public void writeInit() throws IOException {
}
/*
* Writes the assembly code that effects the label command"""
*/
public void writeLabel(String label) throws IOException {
}
/*
* Writes the assembly code that effects the goto command"""
*/
public void writeGoto(String label) throws IOException {
}
/*
* Writes the assembly code that effects the if-goto command"""
*/
public void writeIf(String label) throws IOException {
}
/*
* Writes the assembly code that effects the call command"""
*/
public void writeCall(String functionName, int numArgs) throws IOException {
}
/*
* Writes the assembly code that effects the return command"""
*/
public void writeReturn() throws IOException {
}
/*
* Writes the assembly code that effects the function command"""
*/
public void writeFunction(String functionName, int numLocals)
throws IOException {
}
|