コード例 #1
0
        public RegisterRangeEditorViewModel(RangeModel originalRangeModel)
        {
            if (originalRangeModel == null)
                throw new ArgumentNullException(nameof(originalRangeModel));

            _originalRangeModel = originalRangeModel;

            _name = originalRangeModel.Name;
            _startingRegisterIndex = originalRangeModel.StartIndex;
            _registerType = originalRangeModel.RegisterType;

            if (originalRangeModel.Fields != null)
            {
                Fields.AddRange(originalRangeModel.Fields.Select(f => new FieldEditorViewModel(f.Clone())));
            }

            OkCommand = new RelayCommand(Ok, CanOk);
            CancelCommand = new RelayCommand(Cancel);

            MoveUpCommand = new RelayCommand(MoveUp, CanMoveUp);
            MoveDownCommand = new RelayCommand(MoveDown, CanMoveDown);
            DeleteCommand = new RelayCommand(Delete, CanDelete);
            MoveToTopCommand = new RelayCommand(MoveToTop, CanMoveToTop);
            MoveToBottomCommand = new RelayCommand(MoveToBottom, CanMoveToBottom);
            InsertAboveCommand = new RelayCommand(InsertAbove, CanInsertAbove);
            InsertBelowCommand = new RelayCommand(InsertBelow, CanInsertBelow);

            _fields.CollectionChanged += FieldsOnCollectionChanged;
        }
コード例 #2
0
ファイル: SimRegister.cs プロジェクト: yonglehou/MOSA-Project
		public SimRegister(string name, int index, RegisterType registerType, int size, bool physical)
		{
			this.Index = index;
			this.RegisterType = registerType;
			this.Size = size;
			this.Physical = physical;
			this.Name = name;
		}
コード例 #3
0
 public Register GetRegister(RegisterType type)
 {
     ReadRegisters();
     if (type != RegisterType.CPSR)
         return this.registers[(int)type];
     else
         return this.registers[16];
 }
コード例 #4
0
 public SimRegister(string name, int index, RegisterType registerType, int size, bool physical)
 {
     Index = index;
     RegisterType = registerType;
     Size = size;
     Physical = physical;
     Name = name;
 }
コード例 #5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="type">
        ///     Defines the type of node (either TM, CN or CS)
        /// </param>
        /// <param name="parallelThreads">
        ///     The number of threads that could be efficiently run in parallel
        /// </param>
        /// <param name="problems">
        ///     Gives the list of names of the problems which could be solved (probably sth
        ///     like DVRP-[group no.])
        /// </param>
        public RegisterMessage(RegisterType type, byte parallelThreads, string[] problems)
        {
            Type = type;
            ParallelThreads = parallelThreads;
            SolvableProblems = problems;

            Deregister = false;

            DeregisterSpecified = true;
            IdSpecified = false;
        }
コード例 #6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="type">
        ///     Defines the type of node (either TM, CN or CS)
        /// </param>
        /// <param name="parallelThreads">
        ///     The number of threads that could be efficiently run in parallel
        /// </param>
        /// <param name="problems">
        ///     Gives the list of names of the problems which could be solved (probably sth
        ///     like DVRP-[group no.])
        /// </param>
        /// <param name="deregister">
        ///     When used to inform Backup Server of the need to remove element
        ///     should be set to true
        /// </param>
        /// <param name="id">
        ///     When used to inform Backup Server of the need
        ///     to add/remove element should be set to ID given by main server
        /// </param>
        public RegisterMessage(RegisterType type, byte parallelThreads, string[] problems, bool deregister, ulong id)
        {
            Type = type;
            ParallelThreads = parallelThreads;
            SolvableProblems = problems;
            Deregister = deregister;
            Id = id;

            DeregisterSpecified = true;
            IdSpecified = true;

        }
コード例 #7
0
		public Register32Bit(string name, int index, RegisterType registerType)
			: base(name, index, registerType, 32, true)
		{
		}
コード例 #8
0
        // Determines what data to verify on confirmation page
        private void ConfirmationPage(RegisterType type, IFeeCalculation feeCalculation)
        {
            if (RegisterMgr.OnConfirmationRedirectPage())
            {
                RegisterMgr.ClickAdvantageNo();
            }

            switch (type)
            {
                case RegisterType.ProEvent_Single:
                case RegisterType.ProEvent_Update:
                case RegisterType.ProEvent_Group:
                case RegisterType.Membership:
                case RegisterType.ProEvent_Simple:
                case RegisterType.EnduranceEvent_Single_USD:
                    this.VerifyConfirmationFeeTotals(feeCalculation);
                    break;

                case RegisterType.EnduranceEvent_Single_Pound:
                    this.VerifyConfirmationFeeTotals(feeCalculation, MoneyTool.CurrencyCode.GBP);
                    break;
            }
        }
コード例 #9
0
 public RegisterServiceAttribute(Type registerAs, RegisterType type)
 {
     RegistrationType = type;
     RegisterAs       = registerAs;
 }
コード例 #10
0
    /// \brief Attempts to write a block of data to the Wii Remote's internal registers.
    /// \param type The type of register you would like to write to
    /// \param offset The starting offset of the block of data you would like to write
    /// \param data Data to write to registers at \c offset.  This must have a maximum length of 16.
    /// \return On success, > 0, <= 0 on failure.
    /// \warning If data.Length > 16 the write request will be ignored.
    /// 
    /// Writing to the Wii Remote's internal registers allows you to access advanced functions of the remote, such as
    /// the speakers or the IR camera.  It is used by some of WiimoteApi's setup functions (SetupIRCamera()
    /// for example).
    /// 
    /// If you use this incorrectly (for example, if you attempt to write to a read-only register) the Wii Remote handles this gracefully
    /// and nothing happens.
    public int SendRegisterWriteRequest(RegisterType type, int offset, byte[] data)
    {
        if (data.Length > 16) return -2;


        byte address_select = (byte)type;
        byte[] offsetArr = IntToBigEndian(offset, 3);

        byte[] total = new byte[21];
        total[0] = address_select;
        for (int x = 0; x < 3; x++) total[x + 1] = offsetArr[x];
        total[4] = (byte)data.Length;
        for (int x = 0; x < data.Length; x++) total[x + 5] = data[x];

        return SendWithType(OutputDataType.WRITE_MEMORY_REGISTERS, total);
    }
コード例 #11
0
ファイル: ErrorLog.cs プロジェクト: hacikaraa/Goldepus
 private static bool RegisterLog(ErrorLogObject errorLog, RegisterType register, List<string> ReceiverMails)
 {
     switch (register)
     {
         case RegisterType.Database:
             return Database(errorLog);
         case RegisterType.Mail:
             return Mail(errorLog, ReceiverMails);
         case RegisterType.LogFile:
             return LogFile(errorLog);
         case RegisterType.DataBaseAndMail:
             return Database(errorLog) & Mail(errorLog, ReceiverMails);
         case RegisterType.LogFileAndMail:
             return LogFile(errorLog) & Mail(errorLog, ReceiverMails);
         case RegisterType.DatabaseAndLogFile:
             return Database(errorLog) & LogFile(errorLog);
         case RegisterType.All:
             return Database(errorLog) & LogFile(errorLog) & Mail(errorLog, ReceiverMails);
         default:
             throw new Exception("Log Kayıt Tipi Seçilmedi");
     }
 }
コード例 #12
0
 public RegisterFloatingPoint(string name, int index, RegisterType registerType, bool physical)
     : base(name, index, registerType, 128, physical)
 {
 }
コード例 #13
0
 public RegistedEquipment(RegisterType controllerType, bool isOnly)
 {
     ControllerType = controllerType;
     IsOnly         = isOnly;
 }
        public void InitArray(int ArrayIndex, Int32[] Values)
        {
            this.Type = RegisterType.Array;
              this.ArrayIndex = ArrayIndex;

              for (int i = 0; i < Values.Length; i++)
            ArrayValue[ArrayIndex + i] = Values[i];
        }
コード例 #15
0
ファイル: Operand.cs プロジェクト: gamedropswithpops/Ryujinx
 private static int PackRegInfo(int index, RegisterType type)
 {
     return(((int)type << 24) | index);
 }
コード例 #16
0
        private void Load(ShaderModel shader)
        {
            ConstantDeclarations = shader.ConstantTable.ConstantDeclarations;
            foreach (var constantDeclaration in ConstantDeclarations)
            {
                RegisterType registerType;
                switch (constantDeclaration.RegisterSet)
                {
                case RegisterSet.Bool:
                    registerType = RegisterType.ConstBool;
                    break;

                case RegisterSet.Float4:
                    registerType = RegisterType.Const;
                    break;

                case RegisterSet.Int4:
                    registerType = RegisterType.ConstInt;
                    break;

                case RegisterSet.Sampler:
                    registerType = RegisterType.Sampler;
                    break;

                default:
                    throw new InvalidOperationException();
                }
                if (registerType == RegisterType.Sampler)
                {
                    // Use declaration from declaration instruction instead
                    continue;
                }
                for (uint r = 0; r < constantDeclaration.RegisterCount; r++)
                {
                    var registerKey         = new RegisterKey(registerType, constantDeclaration.RegisterIndex + r);
                    var registerDeclaration = new RegisterDeclaration(registerKey);
                    _registerDeclarations.Add(registerKey, registerDeclaration);
                }
            }

            foreach (var instruction in shader.Tokens.OfType <InstructionToken>().Where(i => i.HasDestination))
            {
                if (instruction.Opcode == Opcode.Dcl)
                {
                    var         registerDeclaration = new RegisterDeclaration(instruction);
                    RegisterKey registerKey         = registerDeclaration.RegisterKey;

                    _registerDeclarations.Add(registerKey, registerDeclaration);

                    switch (registerKey.Type)
                    {
                    case RegisterType.Input:
                    case RegisterType.MiscType:
                    case RegisterType.Texture when shader.Type == ShaderType.Pixel:
                        MethodInputRegisters.Add(registerKey, registerDeclaration);
                        break;

                    case RegisterType.Output:
                    case RegisterType.ColorOut:
                    case RegisterType.AttrOut when shader.MajorVersion == 3 && shader.Type == ShaderType.Vertex:
                        MethodOutputRegisters.Add(registerKey, registerDeclaration);
                        break;

                    case RegisterType.Sampler:
                    case RegisterType.Addr:
                        break;

                    default:
                        throw new Exception($"Unexpected dcl {registerKey.Type}");
                    }
                }
                else if (instruction.Opcode == Opcode.Def)
                {
                    var constant = new Constant(
                        instruction.GetParamRegisterNumber(0),
                        instruction.GetParamSingle(1),
                        instruction.GetParamSingle(2),
                        instruction.GetParamSingle(3),
                        instruction.GetParamSingle(4));
                    _constantDefinitions.Add(constant);
                }
                else if (instruction.Opcode == Opcode.DefI)
                {
                    var constantInt = new ConstantInt(instruction.GetParamRegisterNumber(0),
                                                      instruction.Data[1],
                                                      instruction.Data[2],
                                                      instruction.Data[3],
                                                      instruction.Data[4]);
                    _constantIntDefinitions.Add(constantInt);
                }
                else
                {
                    // Find all assignments to color outputs, because pixel shader outputs are not declared.
                    int          destIndex      = instruction.GetDestinationParamIndex();
                    RegisterType registerType   = instruction.GetParamRegisterType(destIndex);
                    var          registerNumber = instruction.GetParamRegisterNumber(destIndex);
                    var          registerKey    = new RegisterKey(registerType, registerNumber);
                    if (_registerDeclarations.ContainsKey(registerKey) == false)
                    {
                        var reg = new RegisterDeclaration(registerKey);
                        _registerDeclarations[registerKey] = reg;
                        switch (registerType)
                        {
                        case RegisterType.AttrOut:
                        case RegisterType.ColorOut:
                        case RegisterType.DepthOut:
                        case RegisterType.Output:
                        case RegisterType.RastOut:
                            MethodOutputRegisters[registerKey] = reg;
                            break;
                        }
                    }
                }
            }
        }
コード例 #17
0
 public static Int8RegisterGroup CreateNew(int address, RegisterType type = RegisterType.Raw)
 => new Int8RegisterGroup(Register <byte> .CreateByte(address, type));
コード例 #18
0
        string GetRegisterName(Instruction instruction, int paramIndex)
        {
            RegisterType registerType   = instruction.GetParamRegisterType(paramIndex);
            int          registerNumber = instruction.GetParamRegisterNumber(paramIndex);

            var decl = RegisterDeclarations.FirstOrDefault(x => x.RegisterType == registerType && x.RegisterNumber == registerNumber);

            if (decl != null)
            {
                switch (registerType)
                {
                case RegisterType.Texture:
                    return(decl.Name);

                case RegisterType.Input:
                    return((numInputs == 1) ? decl.Name : ("i." + decl.Name));

                case RegisterType.Output:
                    return((numOutputs == 1) ? "o" : ("o." + decl.Name));

                case RegisterType.Sampler:
                    var samplerDecl = ConstantDeclarations.FirstOrDefault(x => x.RegisterSet == RegisterSet.Sampler && x.RegisterIndex == registerNumber);
                    if (samplerDecl != null)
                    {
                        return(samplerDecl.Name);
                    }
                    else
                    {
                        throw new NotImplementedException();
                    }

                case RegisterType.MiscType:
                    if (registerNumber == 0)
                    {
                        return("vFace");
                    }
                    else if (registerNumber == 1)
                    {
                        return("vPos");
                    }
                    else
                    {
                        throw new NotImplementedException();
                    }

                default:
                    throw new NotImplementedException();
                }
            }

            switch (registerType)
            {
            case RegisterType.Const:
                var constDecl = ConstantDeclarations.FirstOrDefault(x => x.ContainsIndex(registerNumber));
                if (constDecl != null)
                {
                    throw new NotImplementedException();
                }
                break;

            case RegisterType.ColorOut:
                return("o");
            }

            return(null);
        }
コード例 #19
0
 public RegisterFloatingPoint(string name, int index, RegisterType registerType)
     : base(name, index, registerType, 128, true)
 {
 }
コード例 #20
0
 public RegisterFloatingPoint(string name, int index, RegisterType registerType, bool physical)
     : base(name, index, registerType, 128, physical)
 {
 }
コード例 #21
0
 public static Operand Register(int index, RegisterType regType, OperandType type)
 {
     return(Operand().With(index, regType, type));
 }
コード例 #22
0
        public static bool Is_Allowed_Reg(Rn regName, ISet <AsmSignatureEnum> allowedOperands)
        {
            RegisterType type = RegisterTools.GetRegisterType(regName);

            switch (type)
            {
            case RegisterType.UNKNOWN:
                AsmDudeToolsStatic.Output_INFO("AsmSignatureTools: isAllowedReg: registername " + regName + " could not be classified");
                break;

            case RegisterType.BIT8:
                if (allowedOperands.Contains(AsmSignatureEnum.R8))
                {
                    return(true);
                }

                if ((regName == Rn.AL) && allowedOperands.Contains(AsmSignatureEnum.REG_AL))
                {
                    return(true);
                }

                if ((regName == Rn.CL) && allowedOperands.Contains(AsmSignatureEnum.REG_CL))
                {
                    return(true);
                }

                break;

            case RegisterType.BIT16:
                if (allowedOperands.Contains(AsmSignatureEnum.R16))
                {
                    return(true);
                }

                if ((regName == Rn.AX) && allowedOperands.Contains(AsmSignatureEnum.REG_AX))
                {
                    return(true);
                }

                if ((regName == Rn.CX) && allowedOperands.Contains(AsmSignatureEnum.REG_CX))
                {
                    return(true);
                }

                if ((regName == Rn.DX) && allowedOperands.Contains(AsmSignatureEnum.REG_DX))
                {
                    return(true);
                }

                break;

            case RegisterType.BIT32:
                if (allowedOperands.Contains(AsmSignatureEnum.R32))
                {
                    return(true);
                }

                if ((regName == Rn.EAX) && allowedOperands.Contains(AsmSignatureEnum.REG_EAX))
                {
                    return(true);
                }

                if ((regName == Rn.ECX) && allowedOperands.Contains(AsmSignatureEnum.REG_ECX))
                {
                    return(true);
                }

                if ((regName == Rn.EDX) && allowedOperands.Contains(AsmSignatureEnum.REG_EDX))
                {
                    return(true);
                }

                break;

            case RegisterType.BIT64:
                if (allowedOperands.Contains(AsmSignatureEnum.R64))
                {
                    return(true);
                }

                if ((regName == Rn.RAX) && allowedOperands.Contains(AsmSignatureEnum.REG_RAX))
                {
                    return(true);
                }

                if ((regName == Rn.RCX) && allowedOperands.Contains(AsmSignatureEnum.REG_RCX))
                {
                    return(true);
                }

                break;

            case RegisterType.MMX:
                if (allowedOperands.Contains(AsmSignatureEnum.MMXREG))
                {
                    return(true);
                }

                break;

            case RegisterType.XMM:
                if (allowedOperands.Contains(AsmSignatureEnum.XMMREG))
                {
                    return(true);
                }

                if ((regName == Rn.XMM0) && allowedOperands.Contains(AsmSignatureEnum.REG_XMM0))
                {
                    return(true);
                }

                break;

            case RegisterType.YMM:
                if (allowedOperands.Contains(AsmSignatureEnum.YMMREG))
                {
                    return(true);
                }

                break;

            case RegisterType.ZMM:
                if (allowedOperands.Contains(AsmSignatureEnum.ZMMREG))
                {
                    return(true);
                }

                break;

            case RegisterType.OPMASK:
                if (allowedOperands.Contains(AsmSignatureEnum.K))
                {
                    return(true);
                }

                break;

            case RegisterType.SEGMENT:
                if (allowedOperands.Contains(AsmSignatureEnum.REG_SREG))
                {
                    return(true);
                }

                switch (regName)
                {
                case Rn.CS: if (allowedOperands.Contains(AsmSignatureEnum.REG_CS))
                    {
                        return(true);
                    }
                    break;

                case Rn.DS: if (allowedOperands.Contains(AsmSignatureEnum.REG_DS))
                    {
                        return(true);
                    }
                    break;

                case Rn.ES: if (allowedOperands.Contains(AsmSignatureEnum.REG_ES))
                    {
                        return(true);
                    }
                    break;

                case Rn.SS: if (allowedOperands.Contains(AsmSignatureEnum.REG_SS))
                    {
                        return(true);
                    }
                    break;

                case Rn.FS: if (allowedOperands.Contains(AsmSignatureEnum.REG_FS))
                    {
                        return(true);
                    }
                    break;

                case Rn.GS: if (allowedOperands.Contains(AsmSignatureEnum.REG_GS))
                    {
                        return(true);
                    }
                    break;
                }
                break;

            case RegisterType.CONTROL:
                if ((regName == Rn.CR0) && allowedOperands.Contains(AsmSignatureEnum.CR0))
                {
                    return(true);
                }

                if ((regName == Rn.CR1) && allowedOperands.Contains(AsmSignatureEnum.CR1))
                {
                    return(true);
                }

                if ((regName == Rn.CR2) && allowedOperands.Contains(AsmSignatureEnum.CR2))
                {
                    return(true);
                }

                if ((regName == Rn.CR3) && allowedOperands.Contains(AsmSignatureEnum.CR3))
                {
                    return(true);
                }

                if ((regName == Rn.CR4) && allowedOperands.Contains(AsmSignatureEnum.CR4))
                {
                    return(true);
                }

                if ((regName == Rn.CR5) && allowedOperands.Contains(AsmSignatureEnum.CR5))
                {
                    return(true);
                }

                if ((regName == Rn.CR6) && allowedOperands.Contains(AsmSignatureEnum.CR6))
                {
                    return(true);
                }

                if ((regName == Rn.CR7) && allowedOperands.Contains(AsmSignatureEnum.CR7))
                {
                    return(true);
                }

                if ((regName == Rn.CR8) && allowedOperands.Contains(AsmSignatureEnum.CR8))
                {
                    return(true);
                }

                break;

            case RegisterType.DEBUG:
                if (allowedOperands.Contains(AsmSignatureEnum.REG_DREG))
                {
                    return(true);
                }

                break;

            case RegisterType.BOUND:
                if (allowedOperands.Contains(AsmSignatureEnum.BNDREG))
                {
                    return(true);
                }

                break;

            default:
                break;
            }
            return(false);
        }
コード例 #23
0
		public void AddRegister(string name, RegisterType type, idScriptParser parser, idWindow window, idWindowVariable var)
		{
			idRegister register = FindRegister(name);

			if(register == null)
			{
				int regCount = idRegister.RegisterTypeCount[(int) type];
				register = new idRegister(name, type, var);
				
				if(type == RegisterType.String)
				{
					idToken token;
					
					if((token = parser.ReadToken()) != null)
					{
						var.Init(idE.Language.Get(token.ToString()), window);
					}
				}
				else
				{
					for(int i = 0; i < regCount; i++)
					{
						register.Indexes[i] = window.ParseExpression(parser, null);

						if(i < (regCount - 1))
						{
							parser.ExpectTokenString(",");
						}
					}
				}

				_registers.Add(register);
				_registerDict.Add(name, register);
			}
			else
			{
				int regCount = idRegister.RegisterTypeCount[(int) type];

				register.Variable = var;

				if(type == RegisterType.String)
				{
					idToken token = parser.ReadToken();

					if(token != null)
					{
						var.Init(token.ToString(), window);
					}
				}
				else
				{
					for(int i = 0; i < regCount; i++)
					{
						register.Indexes[i] = window.ParseExpression(parser, null);

						if(i < (regCount - 1))
						{
							parser.ExpectTokenString(",");
						}
					}
				}
			}
		}
 public void InitLink(Register Link)
 {
     Type = RegisterType.Link;
       LinkedRegisterValue = Link;
 }
コード例 #25
0
ファイル: Register.cs プロジェクト: zhubaojian/Ryujinx
 public Register(int index, RegisterType type)
 {
     Index = index;
     Type  = type;
 }
コード例 #26
0
ファイル: ErrorLog.cs プロジェクト: hacikaraa/Goldepus
 public static bool CreateLog(string exceptionCode, string exceptionMessage, string note, RegisterType register = RegisterType.DataBaseAndMail, List<string> ReceiverMails = null)
 {
     return SetAndCreateLog(0, string.Empty, string.Empty, string.Empty, string.Empty, exceptionCode, exceptionMessage, note, string.Empty, string.Empty, string.Empty, register, ReceiverMails);
 }
コード例 #27
0
 public static Operand Register(int index, RegisterType type)
 {
     return(Register(new Register(index, type)));
 }
コード例 #28
0
        /// <summary>
        ///     removes a node from the client list
        ///     BIG TODO, REMOVE BACKUP SERVER FROM ARRAY
        /// </summary>
        /// <param name="id"></param>
        /// <param name="type"></param>
        public bool RemoveNode(ulong id, RegisterType type)
        {
            switch (type)
            {
                case RegisterType.CommunicationServer:
                    return(removeBackupServer(id));

                case RegisterType.ComputationalNode:
                    return(removeCompNode(id));

                case RegisterType.TaskManager:
                    return(removeTaskManager(id));

            }
            return false;
        }
コード例 #29
0
ファイル: RegisterAttribute.cs プロジェクト: xinyanmsft/clrmd
 public RegisterAttribute(RegisterType registerType)
 {
     RegisterType = registerType;
 }
コード例 #30
0
    /// \brief Requests the Wii Remote to report data from its internal registers.
    /// \param type The type of register you would like to read from
    /// \param offset The starting offset of the block of data you would like to read
    /// \param size The size of the block of data you would like to read
    /// \param Responder This will be called when the Wii Remote finishes reporting the requested data.
    /// \return On success, > 0, <= 0 on failure.
    /// \sa SendRegisterWriteRequest(RegisterType, int, byte[])
    ///
    /// \warning Do not attempt to read from the registers when another read is pending (that is, data is being
    ///          recieved by the Wii Remote).  If you attempt to do this, the new read request will be ignored.
    /// 
    /// Reading from the Wii Remote's internal registers can give important data not available through normal output reports.
    /// This can, for example, be used to read saved Mii data from the Wii Remote's EEPROM registers.  It is also used by some
    /// of WiimoteApi's setup functions.
    /// 
    /// If you use this incorrectly (for example, if you attempt to read from an invalid block of data), \c Responder will not be called.
    public int SendRegisterReadRequest(RegisterType type, int offset, int size, ReadResponder Responder)
    {
        if (CurrentReadData != null)
        {
            Debug.LogWarning("Aborting read request; There is already a read request pending!");
            return -2;
        }


        CurrentReadData = new RegisterReadData(offset, size, Responder);

        byte address_select = (byte)type;
        byte[] offsetArr = IntToBigEndian(offset, 3);
        byte[] sizeArr = IntToBigEndian(size, 2);

        byte[] total = new byte[] { address_select, offsetArr[0], offsetArr[1], offsetArr[2], 
            sizeArr[0], sizeArr[1] };

        return SendWithType(OutputDataType.READ_MEMORY_REGISTERS, total);
    }
コード例 #31
0
ファイル: Operand.cs プロジェクト: scorpiofoxefim/Ryujinx
 public Operand With(int index, RegisterType regType, OperandType type)
 {
     return(With(OperandKind.Register, type, (ulong)((int)regType << 24 | index)));
 }
コード例 #32
0
		public Register32Bit(string name, int index, RegisterType registerType, bool physical)
			: base(name, index, registerType, 32, physical)
		{
		}
コード例 #33
0
 private void Ldloc(int index, RegisterType type, RegisterSize size)
 {
     AddOperation(Operation.LoadLocal(index, type, size));
 }
コード例 #34
0
        // Determines what data to verify on checkout page
        private void CheckoutPage(RegisterType type, IFeeCalculation feeCalculation, RegisterManager.PaymentMethod paymentMethod)
        {
            switch (type)
            {
                case RegisterType.ProEvent_Single:
                case RegisterType.ProEvent_Group:
                case RegisterType.Membership:
                case RegisterType.ProEvent_Simple:
                case RegisterType.ProEvent_Update:
                    this.VerifyCheckoutFeeTotals(feeCalculation);
                    RegisterMgr.PayMoney(paymentMethod);
                    RegisterMgr.FinishRegistration();
                    break;

                case RegisterType.EnduranceEvent_Single_USD:
                    this.VerifyCheckoutFeeTotals(feeCalculation);
                    RegisterMgr.ClickCheckoutActiveWaiver();
                    RegisterMgr.PayMoney(paymentMethod);
                    RegisterMgr.FinishRegistration();
                    break;

                case RegisterType.EnduranceEvent_Single_Pound:
                    this.VerifyCheckoutFeeTotals(feeCalculation, MoneyTool.CurrencyCode.GBP);
                    RegisterMgr.ClickCheckoutActiveWaiver();
                    RegisterMgr.PayMoney(paymentMethod);
                    RegisterMgr.FinishRegistration();
                    break;
            }
        }
コード例 #35
0
 private void Stloc(int index, RegisterType type)
 {
     AddOperation(Operation.StoreLocal(index, type, CurrOp.RegisterSize));
 }
コード例 #36
0
 private void RegisterForEnduranceEvent_USD(RegisterType testType)
 {
     this.CheckinPage();
     this.PersonalInfoPage();
     this.AgendaPage(EventType.Endurance_USD);
     this.LodgingAndTravelPage();
     RegisterMgr.Continue();
     this.MerchandisePage();
     this.CheckoutPage(testType, EnduranceEvent_USD.FeeCalculation_SingleReg.Default, RegisterManager.PaymentMethod.CreditCard);
     this.ConfirmationPage(testType, EnduranceEvent_USD.FeeCalculation_SingleReg.Default);
     this.regId = RegisterMgr.GetRegID();
 }
コード例 #37
0
 public DependencyRegisterGenericAttribute(RegisterType registerType)
 {
     Type = registerType;
 }
コード例 #38
0
 public RegisterFloatingPoint(string name, int index, RegisterType registerType)
     : base(name, index, registerType, 128, true)
 {
 }
コード例 #39
0
 public static Int16RegisterGroup CreateNew(int groupAddress, RegisterType type = RegisterType.Raw)
 {
     return(new Int16RegisterGroup(Enumerable.Range(groupAddress, sizeof(short))
                                   .Select(address => Register <byte> .CreateByte(address, type))
                                   .ToArray()));
 }
 public void CreateArray(int Count)
 {
     Type = RegisterType.Array;
       ArrayValue = new Int32[Count];
 }
コード例 #41
0
ファイル: ErrorLog.cs プロジェクト: hacikaraa/Goldepus
 public static bool CreateLog(int projectId, string projectName, string module, string className, string function, string exceptionCode, string exceptionMessage, string note, string description, string userIp, string device, RegisterType register = RegisterType.DataBaseAndMail, List<string> ReceiverMails = null)
 {
     return SetAndCreateLog(projectId, projectName, module, className, function, exceptionCode, exceptionMessage, note, description, userIp, device, register, ReceiverMails);
 }
 public void InitIntegerValue(Int32 Value)
 {
     Type = RegisterType.Value;
       IntValue = Value;
 }
コード例 #43
0
 public DependencyRegisterGenericAttribute()
 {
     Type = RegisterType.InstancePerDependency;
 }
 public Register(VirtualMachine VM, RegisterType Type)
     : this(VM)
 {
     this.Type = Type;
 }
コード例 #45
0
        public ThreadService(IDataReader dataReader)
        {
            _dataReader = dataReader;

            Type contextType;

            switch (dataReader.GetArchitecture())
            {
            case Architecture.Amd64:
                // Dumps generated with newer dbgeng have bigger context buffers and clrmd requires the context size to at least be that size.
                _contextSize  = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? 0x700 : AMD64Context.Size;
                _contextFlags = AMD64Context.ContextControl | AMD64Context.ContextInteger | AMD64Context.ContextSegments;
                contextType   = typeof(AMD64Context);
                break;

            case Architecture.X86:
                _contextSize  = X86Context.Size;
                _contextFlags = X86Context.ContextControl | X86Context.ContextInteger | X86Context.ContextSegments;
                contextType   = typeof(X86Context);
                break;

            case Architecture.Arm64:
                _contextSize  = Arm64Context.Size;
                _contextFlags = Arm64Context.ContextControl | Arm64Context.ContextInteger;
                contextType   = typeof(Arm64Context);
                break;

            case Architecture.Arm:
                _contextSize  = ArmContext.Size;
                _contextFlags = ArmContext.ContextControl | ArmContext.ContextInteger;
                contextType   = typeof(ArmContext);
                break;

            default:
                throw new PlatformNotSupportedException($"Unsupported architecture: {dataReader.GetArchitecture()}");
            }

            var registers = new List <RegisterInfo>();
            int index     = 0;

            FieldInfo[] fields = contextType.GetFields(BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic);
            foreach (FieldInfo field in fields)
            {
                RegisterAttribute registerAttribute = field.GetCustomAttributes <RegisterAttribute>(inherit: false).SingleOrDefault();
                if (registerAttribute == null)
                {
                    continue;
                }
                RegisterType registerType = registerAttribute.RegisterType & RegisterType.TypeMask;
                switch (registerType)
                {
                case RegisterType.Control:
                case RegisterType.General:
                case RegisterType.Segments:
                    break;

                default:
                    continue;
                }
                if ((registerAttribute.RegisterType & RegisterType.ProgramCounter) != 0)
                {
                    _instructionPointerIndex = index;
                }
                if ((registerAttribute.RegisterType & RegisterType.StackPointer) != 0)
                {
                    _stackPointerIndex = index;
                }
                if ((registerAttribute.RegisterType & RegisterType.FramePointer) != 0)
                {
                    _framePointerIndex = index;
                }
                FieldOffsetAttribute offsetAttribute = field.GetCustomAttributes <FieldOffsetAttribute>(inherit: false).Single();
                var registerInfo = new RegisterInfo(index, offsetAttribute.Value, Marshal.SizeOf(field.FieldType), registerAttribute.Name ?? field.Name.ToLower());
                registers.Add(registerInfo);
                index++;
            }

            _lookupByName  = registers.ToDictionary((info) => info.RegisterName);
            _lookupByIndex = registers.ToDictionary((info) => info.RegisterIndex);
            _registers     = registers;
        }
コード例 #46
0
ファイル: ErrorLog.cs プロジェクト: hacikaraa/Goldepus
 private static bool SetAndCreateLog(int projectId, string projectName, string module, string className, string function, string exceptionCode, string exceptionMessage, string note, string description, string userIp, string device, RegisterType register, List<string> ReceiverMails)
 {
     ErrorLogObject errorLog = new ErrorLogObject();
     errorLog.ProjectID = projectId;
     errorLog.ProjectName = projectName;
     errorLog.Module = module;
     errorLog.ClassName = className;
     errorLog.Function = function;
     errorLog.ExceptionCode = exceptionCode;
     errorLog.ExceptionMessage = exceptionMessage;
     errorLog.Note = note;
     errorLog.Description = description;
     errorLog.Device = device;
     errorLog.UserIp = userIp;
     errorLog.Date = DateTime.Now;
     return RegisterLog(errorLog, register, ReceiverMails);
 }
コード例 #47
0
 public RegisterTypeViewModel(RegisterType registerType, string display)
 {
     this.RegisterType = registerType;
     this.Display = display;
 }
コード例 #48
0
ファイル: ErrorLog.cs プロジェクト: hacikaraa/Goldepus
 public static bool CreateLog(string projectName, string module, string className, string function, string exceptionCode, string exceptionMessage, string note, RegisterType register = RegisterType.DataBaseAndMail, List<string> ReceiverMails = null)
 {
     return SetAndCreateLog(0, projectName, module, className, function, exceptionCode, exceptionMessage, note, string.Empty, string.Empty, string.Empty, register, ReceiverMails);
 }
コード例 #49
0
ファイル: MipsMachine.cs プロジェクト: Banyc/MIPS
 public Word32b QueryRegister(RegisterType reg)
 {
     return(this.Register.Read(reg));
 }
コード例 #50
0
ファイル: ErrorLog.cs プロジェクト: hacikaraa/Goldepus
 public static bool CreateLog(ErrorLogObject errorLog, RegisterType register = RegisterType.DataBaseAndMail, List<string> ReceiverMails = null)
 {
     return RegisterLog(errorLog, register, ReceiverMails);
 }
コード例 #51
0
ファイル: Register.cs プロジェクト: Konctantin/SharpAssembler
 /// <summary>
 /// Cretae new instance of <see cref="Register"/>
 /// </summary>
 /// <param name="name">Register name.</param>
 /// <param name="value">Register value.</param>
 /// <param name="type">Register type <see cref="RegisterType"/></param>
 private Register(string name, byte value, RegisterType type)
 {
     Name  = name;
     Value = value;
     Type  = type;
 }
コード例 #52
0
ファイル: SimRegister.cs プロジェクト: yonglehou/MOSA-Project
		public SimRegister(string name, int index, RegisterType registerType, int size)
			: this(name, index, registerType, size, false)
		{
		}
コード例 #53
0
ファイル: INCDEC.cs プロジェクト: dxc31202/ZXStudio
        static Token INCDEC(Token token, int baseOpcode)
        {
            if ((token = NextToken(token)) == null)
            {
                return(token);
            }
            if (token.IsRegisterPair)
            {
                switch (token.Value.ToUpper())
                {
                case "BC": StoreOpcode((int)Codes.INC_BC + baseOpcode); return(token);

                case "DE": StoreOpcode((int)Codes.INC_DE + baseOpcode); return(token);

                case "HL": StoreOpcode((int)Codes.INC_HL + baseOpcode); return(token);

                case "SP": StoreOpcode((int)Codes.INC_SP + baseOpcode); return(token);

                case "IX": StoreIXOpcode((int)Codes.INC_HL + baseOpcode); return(token);

                case "IY": StoreIYOpcode((int)Codes.INC_HL + baseOpcode); return(token);
                }
                return(LogError(currentFileName, token, "Expected register pair BC, DE, HL, SP, IX or IY"));
            }
            if (token.IsRegister)
            {
                RegisterType registerType = GetRegisterType(token);
                if (registerType > RegisterType.XH && registerType < RegisterType.YL)
                {
                    switch (registerType)
                    {
                    case RegisterType.XH: StoreIXOpcode((int)Codes.INC_H + (baseOpcode >> 3)); return(token);

                    case RegisterType.XL: StoreIXOpcode((int)Codes.INC_L + (baseOpcode >> 3)); return(token);

                    case RegisterType.YH: StoreIYOpcode((int)Codes.INC_H + (baseOpcode >> 3)); return(token);

                    case RegisterType.YL: StoreIYOpcode((int)Codes.INC_L + (baseOpcode >> 3)); return(token);
                    }
                    return(LogError(currentFileName, token, "Expected register XH, XL, YH or YL"));
                }
                StoreOpcode((int)Codes.INC_B + (baseOpcode >> 3) + ((int)registerType << 3));
                return(token);
            }
            if (token.Value == "(")
            {
                if ((token = NextToken(token)) == null)
                {
                    return(token);
                }
                switch (token.Value.ToUpper())
                {
                case "HL":
                {
                    if ((token = NextToken(token)) == null)
                    {
                        return(token);
                    }
                    if (!CheckCloseBracket(token, true))
                    {
                        return(token);
                    }
                    StoreOpcode((int)Codes.INC_xHL + (baseOpcode >> 3));
                }
                    return(token);

                case "IX":
                {
                    if ((token = NextToken(token)) == null)
                    {
                        return(token);
                    }
                    int offset = 0;
                    if (token.IsSymbol || token.IsEquation)
                    {
                        offset = GetValue(ref token);
                        if ((token = NextToken(token)) == null)
                        {
                            return(token);
                        }
                    }
                    if (!CheckCloseBracket(token, true))
                    {
                        return(token);
                    }
                    StoreIXOpcodeDisplacement((int)Codes.INC_xHL + (baseOpcode >> 3), offset);
                }
                    return(token);

                case "IY":
                {
                    if ((token = NextToken(token)) == null)
                    {
                        return(token);
                    }
                    int offset = 0;
                    if (token.IsSymbol || token.IsEquation)
                    {
                        offset = GetValue(ref token);
                        if ((token = NextToken(token)) == null)
                        {
                            return(token);
                        }
                    }
                    if (!CheckCloseBracket(token, true))
                    {
                        return(token);
                    }
                    StoreIYOpcodeDisplacement((int)Codes.INC_xHL + (baseOpcode >> 3), offset);
                }
                    return(token);

                default:
                    return(LogError(currentFileName, token, "Expecting HL, IX or IY"));
                }
            }
            return(LogError(currentFileName, token, "Expecting Register B, C, D, E, H, L or A"));
        }