From: cuz Date: Mon, 18 Aug 2003 20:14:31 +0000 (+0000) Subject: Fixed addresses crossing 0x10000 X-Git-Tag: V2.12.0~1378 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=da8739609d0b290b1c5800d3e101d1ea1b90c070;p=cc65 Fixed addresses crossing 0x10000 git-svn-id: svn://svn.cc65.org/cc65/trunk@2365 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/da65/attrtab.c b/src/da65/attrtab.c index baa78bbb3..247e645c1 100644 --- a/src/da65/attrtab.c +++ b/src/da65/attrtab.c @@ -69,7 +69,7 @@ static const char* SymTab [0x10000]; -void AddrCheck (unsigned Addr) +static void AddrCheck (unsigned Addr) /* Check if the given address has a valid range */ { if (Addr >= 0x10000) { @@ -112,7 +112,7 @@ void MarkAddr (unsigned Addr, attr_t Attr) const char* MakeLabelName (unsigned Addr) /* Make the default label name from the given address and return it in a * static buffer. - */ + */ { static char LabelBuf [32]; xsprintf (LabelBuf, sizeof (LabelBuf), "L%04X", Addr); diff --git a/src/da65/data.c b/src/da65/data.c index 81c628ae8..d55dda050 100644 --- a/src/da65/data.c +++ b/src/da65/data.c @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 2000 Ullrich von Bassewitz */ -/* Wacholderweg 14 */ -/* D-70597 Stuttgart */ -/* EMail: uz@musoftware.de */ +/* (C) 2000-2003 Ullrich von Bassewitz */ +/* Römerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -226,7 +226,7 @@ unsigned RtsTable (void) while (BytesLeft > 0) { /* Get the address */ - unsigned Addr = GetCodeWord (PC) + 1; + unsigned Addr = (GetCodeWord (PC) + 1) & 0xFFFF; /* In pass 1, define a label, in pass 2 output the line */ if (Pass == 1) { @@ -315,7 +315,7 @@ unsigned TextTable (void) Count = 0; while (Count < BytesLeft && Count < BytesPerLine) { unsigned char C = GetCodeByte (PC + Count); - if (C < 0x20 || C > 0x7E || C == '\"') { + if (C < 0x20 || C > 0x7E || C == '\"') { ++Count; } else { break; diff --git a/src/da65/handler.c b/src/da65/handler.c index b22ffbfaf..490619f8d 100644 --- a/src/da65/handler.c +++ b/src/da65/handler.c @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 2000 Ullrich von Bassewitz */ -/* Wacholderweg 14 */ -/* D-70597 Stuttgart */ -/* EMail: uz@musoftware.de */ +/* (C) 2000-2003 Ullrich von Bassewitz */ +/* Römerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -265,7 +265,7 @@ void OH_Relative (const OpcDesc* D) signed char Offs = GetCodeByte (PC+1); /* Calculate the target address */ - unsigned Addr = (unsigned) (((int) PC+2) + Offs); + unsigned Addr = (((int) PC+2) + Offs) & 0xFFFF; /* Generate a label in pass 1 */ GenerateLabel (D->Flags, Addr); @@ -346,7 +346,7 @@ void OH_BitBranch (const OpcDesc* D) signed char BranchOffs = GetCodeByte (PC+2); /* Calculate the target address for the branch */ - unsigned BranchAddr = (unsigned) (((int) PC+3) + BranchOffs); + unsigned BranchAddr = (((int) PC+3) + BranchOffs) & 0xFFFF; /* Generate labels in pass 1. The bit branch codes are special in that * they don't really match the remainder of the 6502 instruction set (they