This is the counterpart to the RMAC Object Processor assembler. In order
for it to be useful, we need to be able to address things in the OP
sections that refer to 68xxx TEXT and DATA sections--so now that's
possible with a little tweak to the section relocator. Now at version
1.6.1 (we forgot to commit 1.6.0, sorry!).
//
// RLN - Reboot's Linker for the Atari Jaguar console system
//
// RLN - Reboot's Linker for the Atari Jaguar console system
-// Copyright (C) 199x, Allan K. Pratt, 2014-2017 Reboot & Friends
+// Copyright (C) 199x, Allan K. Pratt, 2014-2018 Reboot & Friends
char * PathTail(char *);
void ShowHelp(void);
void ShowVersion(void);
char * PathTail(char *);
void ShowHelp(void);
void ShowVersion(void);
+int OSTLookup(char * sym);
+int OSTAdd(char * name, int type, long value);
+int ProcessFiles(void);
+int doargs(int argc, char * argv[]);
unsigned absreloc; // Absolute relocation flag
unsigned relreloc; // Relative relocation flag
unsigned wordreloc; // Relocate word only flag
unsigned absreloc; // Absolute relocation flag
unsigned relreloc; // Relative relocation flag
unsigned wordreloc; // Relocate word only flag
+ unsigned opreloc; // Relocate OP data address only flag
unsigned swcond; // Switch statement condition
unsigned relocsize; // Relocation record size
unsigned swcond; // Switch statement condition
unsigned relocsize; // Relocation record size
+ unsigned saveBits; // OP data leftover bits save
+ unsigned saveBits2;
// If there is no TEXT relocation data for the selected object file segment
// then update the COF TEXT segment offset allowing for the phrase padding
// If there is no TEXT relocation data for the selected object file segment
// then update the COF TEXT segment offset allowing for the phrase padding
absreloc = (rflg & 0x00000040 ? 1 : 0); // Set absolute relocation flag
relreloc = (rflg & 0x000000A0 ? 1 : 0); // Set relative relocation flag
wordreloc = (rflg & 0x00000002 ? 1 : 0); // Set word relocation flag
absreloc = (rflg & 0x00000040 ? 1 : 0); // Set absolute relocation flag
relreloc = (rflg & 0x000000A0 ? 1 : 0); // Set relative relocation flag
wordreloc = (rflg & 0x00000002 ? 1 : 0); // Set word relocation flag
+ opreloc = (rflg & 0x00000004 ? 1 : 0); // Set OP relocation flag
// Additional processing required for global relocations
if (glblreloc)
// Additional processing required for global relocations
if (glblreloc)
// instruction
olddata = (wordreloc ? GetWord(sptr + addr) : GetLong(sptr + addr));
// instruction
olddata = (wordreloc ? GetWord(sptr + addr) : GetLong(sptr + addr));
+ // If it's a OP QUAD relocation, get the data out of the DATA bits.
+ // Note that because we can't afford to lose the bottom 3 bits of the
+ // relocation record, we lose 3 off the top--which means the maximum
+ // this can store is $1FFFF8 (vs. $FFFFF8).
+ if (opreloc)
+ {
+ saveBits2 = (GetLong(sptr + addr + 8) & 0xE0000000) >> 8; // Upper 3 of data addr
+ saveBits = olddata & 0x7FF;
+ olddata = (olddata & 0xFFFFF800) >> 11;
+ olddata |= saveBits2; // Restore upper 3 bits of data addr
+ }
+
if (rflg & 0x01)
olddata = _SWAPWORD(olddata);
if (rflg & 0x01)
olddata = _SWAPWORD(olddata);
break;
case 0x00000400: // TEXT segment relocation record
// SCPCD : the symbol point to a text segment, we should use the textoffset
break;
case 0x00000400: // TEXT segment relocation record
// SCPCD : the symbol point to a text segment, we should use the textoffset
- newdata = tbase + textoffset + olddata;
+ newdata = tbase + textoffset + olddata;
break;
case 0x00000600: // DATA segment relocation record
break;
case 0x00000600: // DATA segment relocation record
if (wordreloc)
PutWord(sptr + addr, newdata);
if (wordreloc)
PutWord(sptr + addr, newdata);
+ else if (opreloc)
+ {
+ if (vflag > 1)
+ printf("OP reloc: oldata=$%X, newdata=$%X\n", olddata, newdata);
+
+ newdata = ((newdata & 0x00FFFFF8) << 8) | saveBits;
+ PutLong(sptr + addr, newdata);
+ // Strip out extraneous data hitchhikers from 2nd phrase...
+ newdata = GetLong(sptr + addr + 8) & 0x007FFFFF;
+ PutLong(sptr + addr + 8, newdata);
+ }
else
PutLong(sptr + addr, newdata);
}
else
PutLong(sptr + addr, newdata);
}
"| | | | | | |\n"
"|_| |_|_| |_|\n"
"\nReboot's Linker for Atari Jaguar\n"
"| | | | | | |\n"
"|_| |_|_| |_|\n"
"\nReboot's Linker for Atari Jaguar\n"
- "Copyright (c) 199x Allan K. Pratt, 2014-2017 Reboot\n"
+ "Copyright (c) 199x Allan K. Pratt, 2014-2018 Reboot\n"
"V%i.%i.%i %s (%s)\n\n", MAJOR, MINOR, PATCH, __DATE__, PLATFORM);
}
}
"V%i.%i.%i %s (%s)\n\n", MAJOR, MINOR, PATCH, __DATE__, PLATFORM);
}
}
//
// RLN - Reboot's Linker for the Atari Jaguar console system
//
// RLN - Reboot's Linker for the Atari Jaguar console system
-// Copyright (C) 199x Allan K. Pratt, 2011-2015 Reboot & Friends
+// Copyright (C) 199x Allan K. Pratt, 2011-2018 Reboot & Friends
#endif
#define MAJOR 1 // Major version number
#endif
#define MAJOR 1 // Major version number
-#define MINOR 5 // Minor version number
-#define PATCH 2 // Patch release number
+#define MINOR 6 // Minor version number
+#define PATCH 1 // Patch release number
#ifdef WIN32
#define PLATFORM "Win32" // Release platform - Windows
#ifdef WIN32
#define PLATFORM "Win32" // Release platform - Windows