Exemple #1
0
        public HHInstruction(string line)
        {
            string[] parts = line.Split(new char[] { ' ' });
            switch (parts[0])
            {
            case "acc":
                operation = HHOperation.ACC;
                break;

            case "jmp":
                operation = HHOperation.JMP;
                break;

            case "nop":
                operation = HHOperation.NOP;
                break;

            default:
                throw new Exception("Unknown operation: " + parts[0]);
            }
            argument = Convert.ToInt32(parts[1]);
        }
Exemple #2
0
 public HHInstruction(HHInstruction masterInst)
 {
     this.operation = masterInst.operation;
     this.argument  = masterInst.argument;
 }