1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-12-28 16:31:17 +00:00

Use Merlin 32 "putbin" directive

I had missed the existence of Merlin 32's PUTBIN directive, which
provides the binary include feature.
This commit is contained in:
Andy McFadden 2024-06-01 10:24:41 -07:00
parent 4e5c34f457
commit 7ca11b0889
2 changed files with 15 additions and 7 deletions

View File

@ -51,6 +51,11 @@ namespace SourceGen.AsmGen {
// IGenerator
public int StartOffset { get { return 0; } }
/// <summary>
/// List of binary include sections found in the project.
/// </summary>
private List<BinaryInclude.Excision> mBinaryIncludes = new List<BinaryInclude.Excision>();
/// <summary>
/// Working directory, i.e. where we write our output file(s).
/// </summary>
@ -133,7 +138,7 @@ namespace SourceGen.AsmGen {
{ "Uninit", "ds" },
//Junk
//Align
//BinaryInclude
{ "BinaryInclude", "putbin" },
{ "StrGeneric", "asc" },
{ "StrReverse", "rev" },
//StrNullTerm
@ -244,8 +249,7 @@ namespace SourceGen.AsmGen {
}
mOutStream = null;
return new GenerationResults(pathNames, string.Empty,
new List<BinaryInclude.Excision>());
return new GenerationResults(pathNames, string.Empty, mBinaryIncludes);
}
// IGenerator
@ -318,7 +322,6 @@ namespace SourceGen.AsmGen {
break;
case FormatDescriptor.Type.Uninit:
case FormatDescriptor.Type.Junk:
case FormatDescriptor.Type.BinaryInclude: // not supported, gen minimal output
int fillVal = Helper.CheckRangeHoldsSingleValue(data, offset, length);
if (fillVal >= 0) {
opcodeStr = sDataOpNames.Fill;
@ -350,6 +353,12 @@ namespace SourceGen.AsmGen {
OutputDenseHex(offset, length, labelStr, commentStr);
}
break;
case FormatDescriptor.Type.BinaryInclude:
opcodeStr = sDataOpNames.BinaryInclude;
string biPath = BinaryInclude.ConvertPathNameFromStorage(dfd.Extra);
operandStr = biPath; // no quotes
mBinaryIncludes.Add(new BinaryInclude.Excision(offset, length, biPath));
break;
case FormatDescriptor.Type.StringGeneric:
case FormatDescriptor.Type.StringReverse:
case FormatDescriptor.Type.StringNullTerm:

View File

@ -9,9 +9,8 @@ L1000 ldy #$28
lda done-1
jmp done
:L1017 hex 20212223242526272829303132333435363738394142434445464748494a5051
hex 5253545556575859
:L103F ds 32,$ff
:L1017 putbin 20300-1.bin
:L103F putbin 20300sub/20300-2.bin
done rts