New --hexoffs option

git-svn-id: svn://svn.cc65.org/cc65/trunk@2433 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-09-11 20:19:09 +00:00
parent 2c63e4bc0b
commit 30594ce1f1
6 changed files with 29 additions and 1 deletions

View File

@@ -157,6 +157,9 @@ void AddExtLabelRange (unsigned Addr, const char* Name, unsigned Count)
if (Count > 1) {
unsigned Offs;
/* Setup the format string */
const char* Format = UseHexOffs? "$%02X" : "%u";
/* Allocate memory for the dependent label names */
unsigned NameLen = strlen (Name);
char* DepName = xmalloc (NameLen + 7);
@@ -168,7 +171,7 @@ void AddExtLabelRange (unsigned Addr, const char* Name, unsigned Count)
/* Define the labels */
for (Offs = 1; Offs < Count; ++Offs) {
sprintf (DepOffs, "%u", Offs);
sprintf (DepOffs, Format, Offs);
AddLabel (Addr + Offs, atDepLabel, DepName);
}