Fixed a bug in the handling of ranges where the granularity is not one: An

internally generated label could disrupt the output of such a range by
adding an offset not equal to the granularity. The solution is to only
add dependent labels within such a range on all addresses that do not
match the granularity (odd addresses for a .word table for example).


git-svn-id: svn://svn.cc65.org/cc65/trunk@3002 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2004-04-29 14:00:28 +00:00
parent 3ccd9f97c7
commit 1ae117fed8
5 changed files with 191 additions and 53 deletions

View File

@@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 2000-2003 Ullrich von Bassewitz */
/* (C) 2000-2004 Ullrich von Bassewitz */
/* R<>merstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
@@ -63,10 +63,10 @@ typedef enum attr_t {
atNoLabel = 0x00, /* No label for this address */
atExtLabel = 0x10, /* External label */
atIntLabel = 0x20, /* Internally generated label */
atDepLabel = 0x30, /* Dependent label (always extern) */
atDepLabel = 0x40, /* Dependent label */
atStyleMask = 0x0F, /* Output style */
atLabelMask = 0x30 /* Label information */
atLabelMask = 0x70 /* Label information */
} attr_t;
@@ -77,6 +77,9 @@ typedef enum attr_t {
unsigned GetGranularity (attr_t Style);
/* Get the granularity for the given style */
void MarkRange (unsigned Start, unsigned End, attr_t Attr);
/* Mark a range with the given attribute */
@@ -91,6 +94,16 @@ const char* MakeLabelName (unsigned Addr);
void AddLabel (unsigned Addr, attr_t Attr, const char* Name);
/* Add a label */
void AddDepLabel (unsigned Addr, attr_t Attr, const char* BaseName, unsigned Offs);
/* Add a dependent label at the given address using "base name+Offs" as the new
* name.
*/
void AddIntLabelRange (unsigned Addr, const char* Name, unsigned Count);
/* Add an internal label for a range. The first entry gets the label "Name"
* while the others get "Name+offs".
*/
void AddExtLabelRange (unsigned Addr, const char* Name, unsigned Count);
/* Add an external label for a range. The first entry gets the label "Name"
* while the others get "Name+offs".