public override Opcode LoadOpcode(BinaryReader reader) { Opcode leftSide = this.Interpreter.Step(reader); Opcode rightSide = this.Interpreter.Step(reader); // ensure that both sides can return a value if (leftSide is not OpcodeEFF left) { throw new DogmaMachineException("The left side of a RIM operand must be EFF"); } if (rightSide is not OpcodeDEFATTRIBUTE right) { throw new DogmaMachineException("The right side of a RIM operand must be DEFATTRIBUTE"); } this.Change = left; this.Attribute = right; return(this); }
public override Opcode LoadOpcode(BinaryReader reader) { Opcode leftSide = this.Interpreter.Step(reader); Opcode rightSide = this.Interpreter.Step(reader); // ensure that both sides can return a value if (leftSide is not OpcodeDEFENVIDX left) { throw new DogmaMachineException("The left side of a GET operand must be an environment id"); } if (rightSide is not OpcodeDEFATTRIBUTE right) { throw new DogmaMachineException("The right side of a GET operand must be an attribute value"); } this.LeftSide = left; this.RightSide = right; return(this); }