Skip to content

Instantly share code, notes, and snippets.

@duckinator
Created October 10, 2016 07:00
Show Gist options
  • Save duckinator/da71b19c4d45c0694e6b002899378b00 to your computer and use it in GitHub Desktop.
Save duckinator/da71b19c4d45c0694e6b002899378b00 to your computer and use it in GitHub Desktop.
methods = {
0b0000 => :mov,
0b0001 => :add,
0b0010 => :nand,
# ...
}
def execute(opcode, operand1, operand2)
send(methods[opcode], operand1, operand2)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment