1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-26 23:30:03 +00:00

Fixed a bug

git-svn-id: svn://svn.cc65.org/cc65/trunk@3085 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2004-06-04 14:36:54 +00:00
parent b1d7f78bce
commit 361316246b

View File

@ -81,33 +81,33 @@ const char* ED_GetLabelName (const ExprDesc* Expr, long Offs)
case E_LOC_ABS: case E_LOC_ABS:
/* Absolute: numeric address or const */ /* Absolute: numeric address or const */
xsprintf (Buf, sizeof (Buf), "$%04X", (int)(Offs & 0xFFFF)); xsprintf (Buf, sizeof (Buf), "$%04X", (int)(Offs & 0xFFFF));
break; break;
case E_LOC_GLOBAL: case E_LOC_GLOBAL:
case E_LOC_STATIC: case E_LOC_STATIC:
/* Global or static variable */ /* Global or static variable */
if (Offs) { if (Offs) {
xsprintf (Buf, sizeof (Buf), "%s%+ld", xsprintf (Buf, sizeof (Buf), "%s%+ld",
SymGetAsmName (Expr->Sym), Offs); SymGetAsmName (Expr->Sym), Offs);
} else { } else {
xsprintf (Buf, sizeof (Buf), "%s", xsprintf (Buf, sizeof (Buf), "%s",
SymGetAsmName (Expr->Sym)); SymGetAsmName (Expr->Sym));
} }
break; break;
case E_LOC_REGISTER: case E_LOC_REGISTER:
/* Register variable */ /* Register variable */
xsprintf (Buf, sizeof (Buf), "regbank+%u", xsprintf (Buf, sizeof (Buf), "regbank+%u",
(unsigned)(Offs & 0xFFFFU)); (unsigned)((Offs + Expr->Name) & 0xFFFFU));
break; break;
case E_LOC_LITERAL: case E_LOC_LITERAL:
/* Literal in the literal pool */ /* Literal in the literal pool */
if (Offs) { if (Offs) {
xsprintf (Buf, sizeof (Buf), "%s%+ld", xsprintf (Buf, sizeof (Buf), "%s%+ld",
LocalLabelName (Expr->Name), Offs); LocalLabelName (Expr->Name), Offs);
} else { } else {
xsprintf (Buf, sizeof (Buf), "%s", xsprintf (Buf, sizeof (Buf), "%s",
LocalLabelName (Expr->Name)); LocalLabelName (Expr->Name));
} }