Last active
April 12, 2020 12:02
-
-
Save jamesacraig/965963d371b27494fdd0191efef0b64c to your computer and use it in GitHub Desktop.
This file contains 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
# Table of instructions by opcode - name, addressing mode, cycles, bytes | |
_instruction_table = { | |
0x00: ["BRK", AddressingMode.IMPLIED, 7, 1], | |
0xA9: ["LDA", AddressingMode.I, 2, 2], | |
0x4C: ["JMP", AddressingMode.ABSOLUTE, 3, 3], | |
0xEA: ["NOP", AddressingMode.IMPLIED, 2, 1], | |
} | |
# Enum of all instruction names. | |
InstructionName = IntEnum("InstructionName", [(v[0], k) for k, v in _instruction_table.items()]) | |
instr_name = Signal(shape=InstructionName, decoder=InstructionName) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment