예제 #1
0
파일: Registers.cs 프로젝트: xiaobo996/reko
        static Registers()
        {
            var factory = new StorageFactory();

            GpRegisters    = factory.RangeOfReg32(8, "er{0}");
            GpRegisters[7] = new RegisterStorage("sp", 7, 0, PrimitiveType.Ptr32);
            RRegisters     = GpRegisters.Select((r, i) => new RegisterStorage($"r{i}", r.Number, 0, PrimitiveType.Word16)).ToArray();
            ERegisters     = GpRegisters.Select((r, i) => new RegisterStorage($"e{i}", r.Number, 16, PrimitiveType.Word16)).ToArray();
            RlRegisters    = GpRegisters.Select((r, i) => new RegisterStorage($"r{i}l", r.Number, 0, PrimitiveType.Byte)).ToArray();
            RhRegisters    = GpRegisters.Select((r, i) => new RegisterStorage($"r{i}h", r.Number, 8, PrimitiveType.Byte)).ToArray();
            Gp16Registers  = RRegisters.Concat(ERegisters).ToArray();
            Gp8Registers   = RhRegisters.Concat(RlRegisters).ToArray();

            PcRegister = factory.Reg32("pc");
            CcRegister = factory.Reg("ccr", PrimitiveType.Byte);

            ByName = GpRegisters
                     .Concat(Gp16Registers)
                     .Concat(Gp8Registers)
                     .Concat(new[]
            {
                PcRegister,
                CcRegister
            })
                     .ToDictionary(r => r.Name);
        }
예제 #2
0
파일: Registers.cs 프로젝트: qcyb/reko
        static Registers()
        {
            var factory = new StorageFactory();

            GpRegisters        = factory.RangeOfReg64(127, "r{0}");
            PredicateRegisters = factory.RangeOfReg(64, n => $"p{n:00}", PrimitiveType.Bool);
            RegistersByName    = GpRegisters
                                 .Concat(PredicateRegisters)
                                 .ToDictionary(r => r.Name);
        }