From: cuz Date: Fri, 4 Jun 2004 14:36:54 +0000 (+0000) Subject: Fixed a bug X-Git-Tag: V2.12.0~747 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=361316246b77904789636293bafb4dfc70e4e2cd;p=cc65 Fixed a bug git-svn-id: svn://svn.cc65.org/cc65/trunk@3085 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/exprdesc.c b/src/cc65/exprdesc.c index cf0986bf8..7c498eda8 100644 --- a/src/cc65/exprdesc.c +++ b/src/cc65/exprdesc.c @@ -81,33 +81,33 @@ const char* ED_GetLabelName (const ExprDesc* Expr, long Offs) case E_LOC_ABS: /* Absolute: numeric address or const */ - xsprintf (Buf, sizeof (Buf), "$%04X", (int)(Offs & 0xFFFF)); + xsprintf (Buf, sizeof (Buf), "$%04X", (int)(Offs & 0xFFFF)); break; case E_LOC_GLOBAL: case E_LOC_STATIC: /* Global or static variable */ - if (Offs) { - xsprintf (Buf, sizeof (Buf), "%s%+ld", + if (Offs) { + xsprintf (Buf, sizeof (Buf), "%s%+ld", SymGetAsmName (Expr->Sym), Offs); - } else { - xsprintf (Buf, sizeof (Buf), "%s", + } else { + xsprintf (Buf, sizeof (Buf), "%s", SymGetAsmName (Expr->Sym)); - } + } break; case E_LOC_REGISTER: /* Register variable */ - xsprintf (Buf, sizeof (Buf), "regbank+%u", - (unsigned)(Offs & 0xFFFFU)); + xsprintf (Buf, sizeof (Buf), "regbank+%u", + (unsigned)((Offs + Expr->Name) & 0xFFFFU)); break; case E_LOC_LITERAL: /* Literal in the literal pool */ - if (Offs) { - xsprintf (Buf, sizeof (Buf), "%s%+ld", + if (Offs) { + xsprintf (Buf, sizeof (Buf), "%s%+ld", LocalLabelName (Expr->Name), Offs); - } else { + } else { xsprintf (Buf, sizeof (Buf), "%s", LocalLabelName (Expr->Name)); }