Exemplo n.º 1
0
        public static bool ParseShiftInstruction(string parameter, ref EShiftInstruction shiftInst, ref byte shiftCount, ref ERegister rs)
        {
            if (parameter.Length < 4)
            {
                throw new ArgumentException("Invalid Shiftinstruction");
            }

            if (!Enum.TryParse(parameter.Substring(0, 3), true, out shiftInst))
            {
                throw new ArgumentException("Invalid Shiftinstruction");
            }

            parameter = parameter.Substring(3, parameter.Length - 3);

            if (Enum.TryParse(parameter, true, out rs))
            {
                return(true);
            }

            shiftCount = ParseImmediate <byte>(parameter);
            if (shiftCount > 64)
            {
                throw new ArgumentOutOfRangeException();
            }

            return(false);
        }
Exemplo n.º 2
0
 public Arithmetic(ECondition condition, EOpcode opcode, bool setConditionFlags, ERegister rn, ERegister rd, ERegister rs, EShiftInstruction shiftInst, ERegister rm)
 {
     Operand2          = EOperand2.RsShiftRm;
     Condition         = condition;
     Opcode            = opcode;
     SetConditionFlags = setConditionFlags;
     Rn        = rn;
     Rd        = rd;
     Rs        = rs;
     ShiftInst = shiftInst;
     Rm        = rm;
     Decoded   = true;
 }
Exemplo n.º 3
0
 public Arithmetic(ECondition condition, EOpcode opcode, bool setConditionFlags, ERegister rn, ERegister rd, byte shiftCount, EShiftInstruction shiftInst, ERegister rm)
 {
     Operand2          = EOperand2.ImmediateShiftRm;
     Condition         = condition;
     Opcode            = opcode;
     SetConditionFlags = setConditionFlags;
     Rn         = rn;
     Rd         = rd;
     ShiftCount = shiftCount;
     ShiftInst  = shiftInst;
     Rm         = rm;
     Decoded    = true;
 }
Exemplo n.º 4
0
 public DataAccess(ECondition condition, bool load, bool preIndex, bool unsigned, bool writeBack, EDataSize dataSize, ERegister rn, ERegister rd, byte shiftCount, EShiftInstruction shiftInst, ERegister rm)
 {
     Offset     = EOffset.ImmediateShiftRm;
     Condition  = condition;
     Load       = load;
     PreIndex   = preIndex;
     Up         = unsigned;
     WriteBack  = writeBack;
     DataSize   = dataSize;
     Rn         = rn;
     Rd         = rd;
     ShiftCount = shiftCount;
     ShiftInst  = shiftInst;
     Rm         = rm;
     Decoded    = true;
     Linked     = true;
 }
Exemplo n.º 5
0
        public static void ParseShiftInstruction(string parameter, ref EShiftInstruction shiftInst, ref byte shiftCount)
        {
            if (parameter.Length < 4)
            {
                throw new ArgumentException("Invalid Shiftinstruction");
            }

            if (!Enum.TryParse(parameter.Substring(0, 3), true, out shiftInst))
            {
                throw new ArgumentException("Invalid Shiftinstruction");
            }

            parameter  = parameter.Substring(3, parameter.Length - 3);
            shiftCount = ParseImmediate <byte>(parameter);
            if (shiftCount > 64)
            {
                throw new ArgumentOutOfRangeException();
            }
        }