diff --git a/SourceGen/AsmGen/AsmCc65.cs b/SourceGen/AsmGen/AsmCc65.cs index 0306d50..f64a5ae 100644 --- a/SourceGen/AsmGen/AsmCc65.cs +++ b/SourceGen/AsmGen/AsmCc65.cs @@ -265,6 +265,10 @@ namespace SourceGen.AsmGen { } private void GenerateLinkerScript(StreamWriter sw) { + // Use a generic linker script. Note the start address is "%S", which uses the + // command line argument, with a default value of $0200. If we wanted to support + // PRG-style files, with the load address output by the assembler, we'd need to + // add a LOADADDR segment. sw.WriteLine("# 6502bench SourceGen generated linker script for " + mFileNameBase); sw.WriteLine("MEMORY {"); diff --git a/SourceGen/AsmGen/AsmMerlin32.cs b/SourceGen/AsmGen/AsmMerlin32.cs index 4e5513b..08d843a 100644 --- a/SourceGen/AsmGen/AsmMerlin32.cs +++ b/SourceGen/AsmGen/AsmMerlin32.cs @@ -454,9 +454,10 @@ namespace SourceGen.AsmGen { // IGenerator public FormatDescriptor ModifyInstructionOperandFormat(int offset, FormatDescriptor dfd, int operand) { + string badChars = ",{}"; if (dfd.FormatType == FormatDescriptor.Type.NumericLE && dfd.IsStringOrCharacter && - (operand & 0x7f) == (byte)',') { - // Merlin throws an error on comma operands, e.g. LDA #',' + badChars.IndexOf((char)(operand & 0x7f)) >= 0) { + // Merlin throws an error on certain ASCII operands, e.g. LDA #',' dfd = FormatDescriptor.Create(dfd.Length, FormatDescriptor.Type.NumericLE, FormatDescriptor.SubType.None); } diff --git a/SourceGen/RuntimeData/Tips/daily-tips.json b/SourceGen/RuntimeData/Tips/daily-tips.json index 34314bc..e025013 100644 --- a/SourceGen/RuntimeData/Tips/daily-tips.json +++ b/SourceGen/RuntimeData/Tips/daily-tips.json @@ -6,7 +6,7 @@ "Text" : "Many disassemblers assume everything is code, and ask you to separate out the data. SourceGen automatically finds all reachable code, so you just need to identify the places where the code starts." }, { - "Text" : "Data that follows a JSR or JSL should be marked as \"inline data\". This allows the code analyzer to skip over it. Common situations, such as null-terminated strings and addresses, can be handled automatically.", + "Text" : "Data that follows a JSR or JSL should be marked as \"inline data\". This allows the code analyzer to skip over it. Common situations, such as null-terminated strings and addresses, can be handled automatically with an extension script.", "Image" : "print-inline-sample.png" }, {