mirror of
https://github.com/fadden/6502bench.git
synced 2024-10-02 05:57:59 +00:00
Another swing at first-word-is-load-addr
If we set the length word to assemble at address zero, the rest of the code will try to use it as a zero-page label, so don't do that. Instead, we use the start address, creating an overlapping region. Easy enough to edit if that's undesirable. (issue #23)
This commit is contained in:
parent
440eec2396
commit
3c4e6cfe7a
@ -254,8 +254,13 @@ namespace SourceGen {
|
|||||||
|
|
||||||
// Configure the load address.
|
// Configure the load address.
|
||||||
if (Setup.SystemDefaults.GetFirstWordIsLoadAddr(sysDef) && mFileData.Length > 2) {
|
if (Setup.SystemDefaults.GetFirstWordIsLoadAddr(sysDef) && mFileData.Length > 2) {
|
||||||
|
// First two bytes are the load address, code starts at offset +000002. We
|
||||||
|
// need to put the load address into the stream, but don't want it to get
|
||||||
|
// picked up as an address for something else. So we set it to the same
|
||||||
|
// address as the start of the file. The overlapping-address code should do
|
||||||
|
// the right thing with it.
|
||||||
int loadAddr = RawData.GetWord(mFileData, 0, 2, false);
|
int loadAddr = RawData.GetWord(mFileData, 0, 2, false);
|
||||||
mAddrMap.Set(0, 0);
|
mAddrMap.Set(0, loadAddr);
|
||||||
mAddrMap.Set(2, loadAddr);
|
mAddrMap.Set(2, loadAddr);
|
||||||
OperandFormats[0] = FormatDescriptor.Create(2, FormatDescriptor.Type.NumericLE,
|
OperandFormats[0] = FormatDescriptor.Create(2, FormatDescriptor.Type.NumericLE,
|
||||||
FormatDescriptor.SubType.None);
|
FormatDescriptor.SubType.None);
|
||||||
|
Loading…
Reference in New Issue
Block a user