diff --git a/SourceGen/AppSettings.cs b/SourceGen/AppSettings.cs index ffa79cf..47d33b3 100644 --- a/SourceGen/AppSettings.cs +++ b/SourceGen/AppSettings.cs @@ -129,6 +129,7 @@ namespace SourceGen { public const string SRCGEN_ADD_IDENT_COMMENT = "srcgen-add-ident-comment"; public const string SRCGEN_LABEL_NEW_LINE = "srcgen-label-new-line"; public const string SRCGEN_SHOW_CYCLE_COUNTS = "srcgen-show-cycle-counts"; + public const string SRCGEN_OMIT_IMPLIED_ACC_OPERAND = "srcgen-omit-implied-acc-operand"; // Label file generation settings. public const string LABGEN_FORMAT = "labgen-format"; diff --git a/SourceGen/AsmGen/AsmAcme.cs b/SourceGen/AsmGen/AsmAcme.cs index c358fc8..a280f1a 100644 --- a/SourceGen/AsmGen/AsmAcme.cs +++ b/SourceGen/AsmGen/AsmAcme.cs @@ -230,7 +230,7 @@ namespace SourceGen.AsmGen { /// Configures the assembler-specific format items. /// private void SetFormatConfigValues(ref Formatter.FormatConfig config) { - config.SuppressImpliedAcc = true; + config.SuppressImpliedAcc = true; // implied acc not allowed config.OperandWrapLen = 64; config.ForceDirectOpcodeSuffix = "+1"; diff --git a/SourceGen/AsmGen/GenCommon.cs b/SourceGen/AsmGen/GenCommon.cs index 3603bf6..51f69d8 100644 --- a/SourceGen/AsmGen/GenCommon.cs +++ b/SourceGen/AsmGen/GenCommon.cs @@ -512,6 +512,8 @@ namespace SourceGen.AsmGen { settings.GetBool(AppSettings.FMT_ADD_SPACE_FULL_COMMENT, true); config.OperandWrapLen = settings.GetInt(AppSettings.FMT_OPERAND_WRAP_LEN, 0); + config.SuppressImpliedAcc = + settings.GetBool(AppSettings.SRCGEN_OMIT_IMPLIED_ACC_OPERAND, false); config.ForceAbsOpcodeSuffix = settings.GetString(AppSettings.FMT_OPCODE_SUFFIX_ABS, string.Empty); diff --git a/SourceGen/MainController.cs b/SourceGen/MainController.cs index 76141a1..790e653 100644 --- a/SourceGen/MainController.cs +++ b/SourceGen/MainController.cs @@ -508,6 +508,8 @@ namespace SourceGen { settings.GetString(AppSettings.FMT_LOCAL_VARIABLE_PREFIX, string.Empty); mFormatterConfig.CommaSeparatedDense = settings.GetBool(AppSettings.FMT_COMMA_SEP_BULK_DATA, true); + mFormatterConfig.SuppressImpliedAcc = + settings.GetBool(AppSettings.SRCGEN_OMIT_IMPLIED_ACC_OPERAND, false); mFormatterConfig.DebugLongComments = DebugLongComments; string chrDelCereal = settings.GetString(AppSettings.FMT_CHAR_DELIM, null); diff --git a/SourceGen/Tests/GenTest.cs b/SourceGen/Tests/GenTest.cs index 02a3051..4c6c42b 100644 --- a/SourceGen/Tests/GenTest.cs +++ b/SourceGen/Tests/GenTest.cs @@ -456,6 +456,8 @@ namespace SourceGen.Tests { // This could be on or off. Off seems less distracting. settings.SetBool(AppSettings.SRCGEN_SHOW_CYCLE_COUNTS, false); + settings.SetBool(AppSettings.SRCGEN_OMIT_IMPLIED_ACC_OPERAND, false); + IEnumerator iter = AssemblerInfo.GetInfoEnumerator(); while (iter.MoveNext()) { AssemblerInfo.Id asmId = iter.Current.AssemblerId; diff --git a/SourceGen/WpfGui/EditAppSettings.xaml b/SourceGen/WpfGui/EditAppSettings.xaml index 28b39b4..7590d30 100644 --- a/SourceGen/WpfGui/EditAppSettings.xaml +++ b/SourceGen/WpfGui/EditAppSettings.xaml @@ -845,6 +845,8 @@ limitations under the License. IsChecked="{Binding ShowCycleCountsAsm}"/> + -

The Code Generation Settings affect all assemblers.

+

The next section, Code Generation Settings, affects all assemblers.

When show cycle counts in comments is checked, cycle counts are inserted into end-of-line comments. This works the same as @@ -229,6 +229,15 @@ file is sent to other people, since it may not otherwise be obvious from the source file what the intended target assembler is, or what options are required to process the file correctly.

+

Some 6502 instructions have an "implied" accumulator address mode, e.g. +LSR and ASL. The operand may be shown as +"A" to make the address mode explicit, but it can also be +omitted. Some assemblers require it to be present, some require it to be +absent, most allow either. By default, the operand is shown, but enabling +omit implied accumulator operands if allowed will cause it to +be omitted on-screen, in the instruction chart, and in source generated for +assemblers that don't require it to be present.

+

Labels can generally be placed either on the same line as a code or data operand, or on the line before it. Placing them on the same line makes the output a bit more compact, but if the label is longer than the label