示例#1
0
        internal Assembler()
        {
            _codeBuffer  = new CodeBuffer(this);
            _codeContext = new CodeContext(this);

            if (Constants.X64)
            {
                Zdi = new GpRegister(Cpu.Registers.Rdi);
                Zsi = new GpRegister(Cpu.Registers.Rsi);
                Zbp = new GpRegister(Cpu.Registers.Rbp);
                Zsp = new GpRegister(Cpu.Registers.Rsp);
                Zbx = new GpRegister(Cpu.Registers.Rbx);
                Zdx = new GpRegister(Cpu.Registers.Rdx);
                Zcx = new GpRegister(Cpu.Registers.Rcx);
                Zax = new GpRegister(Cpu.Registers.Rax);
            }
            else
            {
                Zdi = new GpRegister(Cpu.Registers.Edi);
                Zsi = new GpRegister(Cpu.Registers.Esi);
                Zbp = new GpRegister(Cpu.Registers.Ebp);
                Zsp = new GpRegister(Cpu.Registers.Esp);
                Zbx = new GpRegister(Cpu.Registers.Ebx);
                Zdx = new GpRegister(Cpu.Registers.Edx);
                Zcx = new GpRegister(Cpu.Registers.Ecx);
                Zax = new GpRegister(Cpu.Registers.Eax);
            }

            _id                 = _idGenerator++;
            _features          |= AssemblerFeatures.OptimizedAlign;
            _instructionOptions = InstructionOptions.None;
        }
示例#2
0
 internal bool HasFeature(AssemblerFeatures feature)
 {
     return(_features.IsSet(feature));
 }