public static GasFormatterOptions ToGas(this IGasDisassemblySettings settings)
        {
            var options = new GasFormatterOptions();

            CopyBase(options, settings);
            options.NakedRegisters               = settings.NakedRegisters;
            options.ShowMnemonicSizeSuffix       = settings.ShowMnemonicSizeSuffix;
            options.SpaceAfterMemoryOperandComma = settings.SpaceAfterMemoryOperandComma;
            return(options);
        }
Beispiel #2
0
        void Verify_default_formatter_options()
        {
            var options = new GasFormatterOptions();

            Assert.False(options.UpperCasePrefixes);
            Assert.False(options.UpperCaseMnemonics);
            Assert.False(options.UpperCaseRegisters);
            Assert.False(options.UpperCaseKeywords);
            Assert.False(options.UpperCaseOther);
            Assert.False(options.UpperCaseAll);
            Assert.Equal(0, options.FirstOperandCharIndex);
            Assert.Equal(0, options.TabSize);
            Assert.False(options.SpaceAfterOperandSeparator);
            Assert.False(options.SpaceAfterMemoryOpenBracket);
            Assert.False(options.SpaceBeforeMemoryCloseBracket);
            Assert.False(options.SpacesBetweenMemoryAddOperators);
            Assert.False(options.SpacesBetweenMemoryMulOperators);
            Assert.False(options.ScaleBeforeIndex);
            Assert.False(options.AlwaysShowScale);
            Assert.False(options.AlwaysShowSegmentRegister);
            Assert.False(options.ShowZeroDisplacements);
            Assert.Equal("0x", options.HexPrefix);
            Assert.Null(options.HexSuffix);
            Assert.Equal(4, options.HexDigitGroupSize);
            Assert.Null(options.DecimalPrefix);
            Assert.Null(options.DecimalSuffix);
            Assert.Equal(3, options.DecimalDigitGroupSize);
            Assert.Equal("0", options.OctalPrefix);
            Assert.Null(options.OctalSuffix);
            Assert.Equal(4, options.OctalDigitGroupSize);
            Assert.Equal("0b", options.BinaryPrefix);
            Assert.Null(options.BinarySuffix);
            Assert.Equal(4, options.BinaryDigitGroupSize);
            Assert.Equal("_", options.DigitSeparator);
            Assert.False(options.AddDigitSeparators);
            Assert.True(options.ShortNumbers);
            Assert.True(options.UpperCaseHex);
            Assert.True(options.SmallHexNumbersInDecimal);
            Assert.True(options.AddLeadingZeroToHexNumbers);
            Assert.Equal(NumberBase.Hexadecimal, options.NumberBase);
            Assert.False(options.ShortBranchNumbers);
            Assert.False(options.SignedImmediateOperands);
            Assert.True(options.SignedMemoryDisplacements);
            Assert.False(options.SignExtendMemoryDisplacements);
            Assert.False(options.AlwaysShowMemorySize);
            Assert.False(options.RipRelativeAddresses);
            Assert.True(options.ShowBranchSize);
            Assert.True(options.UsePseudoOps);
            Assert.False(options.NakedRegisters);
            Assert.False(options.ShowMnemonicSizeSuffix);
            Assert.False(options.SpaceAfterMemoryOperandComma);
        }
Beispiel #3
0
        public void TestOptions()
        {
            var options = new GasFormatterOptions();

            TestOptionsBase(options);
        }