Skip to content

Instantly share code, notes, and snippets.

@qhoxie
Created November 9, 2009 01:28
Show Gist options
  • Save qhoxie/229614 to your computer and use it in GitHub Desktop.
Save qhoxie/229614 to your computer and use it in GitHub Desktop.
def set(reg: Reg, literal: byte): Code = {
return new Code() {
// implementation
}
}
static public Code set(final Reg reg, final byte literal) {
return new Code () {
public void run(State state) {
reg.value = literal;
state.ticks += 1;
}
public void emit() {
emit("ldi", reg, literal);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment