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
func (mc *microcontroller) run() { | |
instruction := (*mc.memory)[mc.programCounter] | |
fmt.Printf("%X : %X\n", mc.programCounter, instruction) | |
switch instruction { | |
case 0x00: | |
mc.nop() | |
case 0xC3: | |
mc.jmp() | |
case 0x01, 0x11, 0x21, 0x31: | |
mc.lxi() |
NewerOlder