Skip to content

Instantly share code, notes, and snippets.

@mlangenberg
Created June 19, 2012 18:04
Show Gist options
  • Save mlangenberg/2955612 to your computer and use it in GitHub Desktop.
Save mlangenberg/2955612 to your computer and use it in GitHub Desktop.
public void code(PrintStream s) {
e1.code(s);
CgenSupport.emitFetchInt(CgenSupport.ACC, CgenSupport.ACC, s);
CgenSupport.emitPush(CgenSupport.ACC, s);
e2.code(s);
CgenSupport.emitFetchInt(CgenSupport.ACC, CgenSupport.ACC, s);
CgenSupport.emitLoad(CgenSupport.T1, 1, CgenSupport.SP, s);
CgenSupport.emitAdd(CgenSupport.ACC, CgenSupport.T1, CgenSupport.ACC, s);
CgenSupport.emitAddiu(CgenSupport.SP, CgenSupport.SP, 4, s);
// Now that result of e1 + e2 is in the accumulator we
// continue to create a new int_const object
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment