-void AddrCheck (unsigned Addr)
+static void AddrCheck (unsigned Addr)
/* Check if the given address has a valid range */
{
if (Addr >= 0x10000) {
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);
/* */
/* */
/* */
-/* (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 */
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) {
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;
/* */
/* */
/* */
-/* (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 */
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);
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