Created
October 10, 2016 07:00
-
-
Save duckinator/da71b19c4d45c0694e6b002899378b00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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