Take BSS into account (like done for Apple GEOS in the first place).

git-svn-id: svn://svn.cc65.org/cc65/trunk@5563 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc
2012-02-27 19:37:32 +00:00
parent e4aab75bb0
commit 5817cf1476

View File

@@ -164,7 +164,7 @@ static void OptTarget (const char* Opt attribute ((unused)), const char* Arg)
static void OptVersion (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print the assembler version */
/* Print the program version */
{
fprintf (stderr,
"grc65 V%s - (C) Copyright, Maciej 'YTM/Elysium' Witkowiak\n",
@@ -785,8 +785,8 @@ static void DoMemory (void)
for (number = 0; number <= lastnumber; number++) {
if (overlaytable[number] == 1) {
fprintf (outputSFile,
"\t.import __VLIR%i_START__, __VLIR%i_LAST__\n",
number, number);
"\t.import __VLIR%i_START__, __VLIR%i_LAST__%s\n",
number, number, number == 0 ? ", __BSS_SIZE__" : "");
}
}
fprintf (outputSFile,
@@ -795,9 +795,10 @@ static void DoMemory (void)
for (number = 0; number <= lastnumber; number++) {
if (overlaytable[number] == 1) {
fprintf (outputSFile,
"\t.byte .lobyte ((__VLIR%i_LAST__ - __VLIR%i_START__ - 1) / 254) + 1\n"
"\t.byte .lobyte ((__VLIR%i_LAST__ - __VLIR%i_START__ - 1) .MOD 254) + 2\n",
number, number, number, number);
"\t.byte .lobyte ((__VLIR%i_LAST__ - __VLIR%i_START__%s - 1) / 254) + 1\n"
"\t.byte .lobyte ((__VLIR%i_LAST__ - __VLIR%i_START__%s - 1) .MOD 254) + 2\n",
number, number, number == 0 ? " - __BSS_SIZE__" : "",
number, number, number == 0 ? " - __BSS_SIZE__" : "");
} else {
fprintf (outputSFile,
"\t.byte $00\n"