Example #1
0
        /// <summary>
        /// Turns the operator type into byte.
        /// </summary>
        /// <returns>The byte.</returns>
        /// <param name="OpType">OpType.</param>
        public byte ByteFromOpType(Instruction.OpType OpType)
        {
            switch (OpType)
            {
            case Instruction.OpType.Add:
                return(0);

            case Instruction.OpType.Subtract:
                return(1);

            case Instruction.OpType.Divide:
                return(2);

            case Instruction.OpType.Mutiply:
                return(3);

            case Instruction.OpType.Allocate:
                return(4);

            case Instruction.OpType.Assign:
                return(5);

            case Instruction.OpType.Interrupt:
                return(6);

            case Instruction.OpType.Compare:
                return(7);

            case Instruction.OpType.Move:
                return(8);

            case Instruction.OpType.Addr:
                return(9);

            case Instruction.OpType.Label:
                return(10);

            case Instruction.OpType.Goto:
                return(11);

            case Instruction.OpType.Clear:
                return(12);

            default:
                throw new Exception("Incorrect OpType: " + OpType);
            }
        }
Example #2
0
 public DIFInstruction(Instruction.OpType op)
 {
     Op = op;
 }