Restructured some of the code. Attribute handling is still a mess and needs
another cleanup. Added unnamed labels. git-svn-id: svn://svn.cc65.org/cc65/trunk@3700 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* attrtab.h */
|
||||
/* attrtab.h */
|
||||
/* */
|
||||
/* Disassembler attribute table */
|
||||
/* Disassembler attribute table */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2000-2005 Ullrich von Bassewitz */
|
||||
/* (C) 2000-2006 Ullrich von Bassewitz */
|
||||
/* R<>merstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/* Data */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
@@ -47,36 +47,42 @@
|
||||
typedef enum attr_t {
|
||||
|
||||
/* Styles */
|
||||
atDefault = 0x00, /* Default style */
|
||||
atCode = 0x01,
|
||||
atIllegal = 0x02,
|
||||
atByteTab = 0x03, /* Same as illegal */
|
||||
atDByteTab = 0x04,
|
||||
atWordTab = 0x05,
|
||||
atDWordTab = 0x06,
|
||||
atAddrTab = 0x07,
|
||||
atRtsTab = 0x08,
|
||||
atTextTab = 0x09,
|
||||
atSkip = 0x0A, /* Skip code completely */
|
||||
atDefault = 0x0000, /* Default style */
|
||||
atCode = 0x0001,
|
||||
atIllegal = 0x0002,
|
||||
atByteTab = 0x0003, /* Same as illegal */
|
||||
atDByteTab = 0x0004,
|
||||
atWordTab = 0x0005,
|
||||
atDWordTab = 0x0006,
|
||||
atAddrTab = 0x0007,
|
||||
atRtsTab = 0x0008,
|
||||
atTextTab = 0x0009,
|
||||
atSkip = 0x000A, /* Skip code completely */
|
||||
|
||||
/* Label flags */
|
||||
atNoLabel = 0x00, /* No label for this address */
|
||||
atExtLabel = 0x10, /* External label */
|
||||
atIntLabel = 0x20, /* Internally generated label */
|
||||
atDepLabel = 0x40, /* Dependent label */
|
||||
atNoLabel = 0x0000, /* No label for this address */
|
||||
atExtLabel = 0x0010, /* External label */
|
||||
atIntLabel = 0x0020, /* Internally generated label */
|
||||
atDepLabel = 0x0040, /* Dependent label */
|
||||
atUnnamedLabel = 0x0080, /* Unnamed label */
|
||||
|
||||
atStyleMask = 0x0F, /* Output style */
|
||||
atLabelMask = 0x70 /* Label information */
|
||||
atLabelDefined = 0x0100, /* True if we defined the label */
|
||||
|
||||
atStyleMask = 0x000F, /* Output style */
|
||||
atLabelMask = 0x00F0 /* Label information */
|
||||
} attr_t;
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Code */
|
||||
/* Code */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
void AddrCheck (unsigned Addr);
|
||||
/* Check if the given address has a valid range */
|
||||
|
||||
unsigned GetGranularity (attr_t Style);
|
||||
/* Get the granularity for the given style */
|
||||
|
||||
@@ -86,53 +92,12 @@ void MarkRange (unsigned Start, unsigned End, attr_t Attr);
|
||||
void MarkAddr (unsigned Addr, attr_t Attr);
|
||||
/* Mark an address with an attribute */
|
||||
|
||||
void AddLabel (unsigned Addr, attr_t Attr, const char* Name, const char* Comment);
|
||||
/* Add a label */
|
||||
|
||||
void AddIntLabel (unsigned Addr);
|
||||
/* Add an internal label using the address to generate the name. */
|
||||
|
||||
void AddExtLabel (unsigned Addr, const char* Name, const char* Comment);
|
||||
/* Add an external 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, const char* Comment, unsigned Count);
|
||||
/* Add an external label for a range. The first entry gets the label "Name"
|
||||
* while the others get "Name+offs".
|
||||
*/
|
||||
|
||||
int HaveLabel (unsigned Addr);
|
||||
/* Check if there is a label for the given address */
|
||||
|
||||
int MustDefLabel (unsigned Addr);
|
||||
/* Return true if we must define a label for this address, that is, if there
|
||||
* is a label at this address, and it is an external or internal label.
|
||||
*/
|
||||
|
||||
const char* GetLabel (unsigned Addr);
|
||||
/* Return the label for an address or NULL if there is none */
|
||||
|
||||
const char* GetComment (unsigned Addr);
|
||||
/* Return the comment for an address */
|
||||
|
||||
unsigned char GetStyleAttr (unsigned Addr);
|
||||
attr_t GetStyleAttr (unsigned Addr);
|
||||
/* Return the style attribute for the given address */
|
||||
|
||||
unsigned char GetLabelAttr (unsigned Addr);
|
||||
attr_t GetLabelAttr (unsigned Addr);
|
||||
/* Return the label attribute for the given address */
|
||||
|
||||
void DefOutOfRangeLabels (void);
|
||||
/* Output any labels that are out of the loaded code range */
|
||||
|
||||
|
||||
|
||||
/* End of attrtab.h */
|
||||
|
||||
Reference in New Issue
Block a user