1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-30 01:50:10 +00:00

Use two .ORGs for first-word-is-load-addr

First is always at zero, second is at the address.  This puts an
ORG directive right at the start of the code, and avoids potentially
assembler-specific wrap-around behavior when the desired load
address is $0000 or $0001.

(issue #23)
This commit is contained in:
Andy McFadden 2018-10-05 17:25:41 -07:00
parent 92add74fc3
commit 440eec2396

View File

@ -253,21 +253,18 @@ namespace SourceGen {
ProjectProps.EntryFlags = Setup.SystemDefaults.GetEntryFlags(sysDef);
// Configure the load address.
int loadAddr;
if (Setup.SystemDefaults.GetFirstWordIsLoadAddr(sysDef) && mFileData.Length > 2) {
loadAddr = RawData.GetWord(mFileData, 0, 2, false);
loadAddr -= 2;
if (loadAddr < 0) {
loadAddr += 65536;
}
int loadAddr = RawData.GetWord(mFileData, 0, 2, false);
mAddrMap.Set(0, 0);
mAddrMap.Set(2, loadAddr);
OperandFormats[0] = FormatDescriptor.Create(2, FormatDescriptor.Type.NumericLE,
FormatDescriptor.SubType.None);
TypeHints[0] = CodeAnalysis.TypeHint.NoHint;
TypeHints[2] = CodeAnalysis.TypeHint.Code;
} else {
loadAddr = Setup.SystemDefaults.GetLoadAddress(sysDef);
}
int loadAddr = Setup.SystemDefaults.GetLoadAddress(sysDef);
mAddrMap.Set(0, loadAddr);
}
foreach (string str in sysDef.SymbolFiles) {
ProjectProps.PlatformSymbolFileIdentifiers.Add(str);