2000-09-24 15:55:57 +00:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* */
|
|
|
|
|
/* attrtab.h */
|
|
|
|
|
/* */
|
|
|
|
|
/* Disassembler attribute table */
|
|
|
|
|
/* */
|
|
|
|
|
/* */
|
|
|
|
|
/* */
|
2005-02-17 17:26:16 +00:00
|
|
|
|
/* (C) 2000-2005 Ullrich von Bassewitz */
|
2003-08-23 09:20:33 +00:00
|
|
|
|
/* R<>merstrasse 52 */
|
|
|
|
|
/* D-70794 Filderstadt */
|
|
|
|
|
/* EMail: uz@cc65.org */
|
2000-09-24 15:55:57 +00:00
|
|
|
|
/* */
|
|
|
|
|
/* */
|
|
|
|
|
/* This software is provided 'as-is', without any expressed or implied */
|
|
|
|
|
/* warranty. In no event will the authors be held liable for any damages */
|
|
|
|
|
/* arising from the use of this software. */
|
|
|
|
|
/* */
|
|
|
|
|
/* Permission is granted to anyone to use this software for any purpose, */
|
|
|
|
|
/* including commercial applications, and to alter it and redistribute it */
|
|
|
|
|
/* freely, subject to the following restrictions: */
|
|
|
|
|
/* */
|
|
|
|
|
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
|
|
|
/* claim that you wrote the original software. If you use this software */
|
|
|
|
|
/* in a product, an acknowledgment in the product documentation would be */
|
|
|
|
|
/* appreciated but is not required. */
|
|
|
|
|
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
|
|
|
/* be misrepresented as being the original software. */
|
|
|
|
|
/* 3. This notice may not be removed or altered from any source */
|
|
|
|
|
/* distribution. */
|
|
|
|
|
/* */
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef ATTRTAB_H
|
|
|
|
|
#define ATTRTAB_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2000-09-29 12:26:34 +00:00
|
|
|
|
/* Data */
|
2000-09-24 15:55:57 +00:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-12-10 10:36:44 +00:00
|
|
|
|
typedef enum attr_t {
|
2000-09-29 12:26:34 +00:00
|
|
|
|
|
|
|
|
|
/* Styles */
|
2000-09-24 15:55:57 +00:00
|
|
|
|
atDefault = 0x00, /* Default style */
|
|
|
|
|
atCode = 0x01,
|
|
|
|
|
atIllegal = 0x02,
|
2000-09-24 20:54:49 +00:00
|
|
|
|
atByteTab = 0x03, /* Same as illegal */
|
2003-08-23 09:20:33 +00:00
|
|
|
|
atDByteTab = 0x04,
|
|
|
|
|
atWordTab = 0x05,
|
|
|
|
|
atDWordTab = 0x06,
|
|
|
|
|
atAddrTab = 0x07,
|
|
|
|
|
atRtsTab = 0x08,
|
|
|
|
|
atTextTab = 0x09,
|
2003-08-23 21:19:20 +00:00
|
|
|
|
atSkip = 0x0A, /* Skip code completely */
|
2000-09-24 15:55:57 +00:00
|
|
|
|
|
2000-09-29 12:26:34 +00:00
|
|
|
|
/* Label flags */
|
|
|
|
|
atNoLabel = 0x00, /* No label for this address */
|
|
|
|
|
atExtLabel = 0x10, /* External label */
|
|
|
|
|
atIntLabel = 0x20, /* Internally generated label */
|
2004-04-29 14:00:28 +00:00
|
|
|
|
atDepLabel = 0x40, /* Dependent label */
|
2000-09-29 12:26:34 +00:00
|
|
|
|
|
|
|
|
|
atStyleMask = 0x0F, /* Output style */
|
2004-04-29 14:00:28 +00:00
|
|
|
|
atLabelMask = 0x70 /* Label information */
|
2000-12-10 10:36:44 +00:00
|
|
|
|
} attr_t;
|
2000-09-24 15:55:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2000-09-29 12:26:34 +00:00
|
|
|
|
/* Code */
|
2000-09-24 15:55:57 +00:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-04-29 14:00:28 +00:00
|
|
|
|
unsigned GetGranularity (attr_t Style);
|
|
|
|
|
/* Get the granularity for the given style */
|
|
|
|
|
|
2000-09-24 15:55:57 +00:00
|
|
|
|
void MarkRange (unsigned Start, unsigned End, attr_t Attr);
|
|
|
|
|
/* Mark a range with the given attribute */
|
|
|
|
|
|
|
|
|
|
void MarkAddr (unsigned Addr, attr_t Attr);
|
|
|
|
|
/* Mark an address with an attribute */
|
|
|
|
|
|
2005-02-16 23:30:05 +00:00
|
|
|
|
void AddLabel (unsigned Addr, attr_t Attr, const char* Name, const char* Comment);
|
2000-09-24 15:55:57 +00:00
|
|
|
|
/* Add a label */
|
|
|
|
|
|
2005-02-16 23:30:05 +00:00
|
|
|
|
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 */
|
|
|
|
|
|
2004-04-29 14:00:28 +00:00
|
|
|
|
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".
|
|
|
|
|
*/
|
|
|
|
|
|
2005-02-16 23:30:05 +00:00
|
|
|
|
void AddExtLabelRange (unsigned Addr, const char* Name, const char* Comment, unsigned Count);
|
2003-08-23 09:20:33 +00:00
|
|
|
|
/* Add an external label for a range. The first entry gets the label "Name"
|
|
|
|
|
* while the others get "Name+offs".
|
|
|
|
|
*/
|
|
|
|
|
|
2000-09-24 15:55:57 +00:00
|
|
|
|
int HaveLabel (unsigned Addr);
|
|
|
|
|
/* Check if there is a label for the given address */
|
|
|
|
|
|
2000-09-29 12:26:34 +00:00
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
|
2000-09-24 15:55:57 +00:00
|
|
|
|
const char* GetLabel (unsigned Addr);
|
2000-09-29 12:26:34 +00:00
|
|
|
|
/* Return the label for an address or NULL if there is none */
|
2000-09-24 15:55:57 +00:00
|
|
|
|
|
2005-02-16 23:30:05 +00:00
|
|
|
|
const char* GetComment (unsigned Addr);
|
|
|
|
|
/* Return the comment for an address */
|
|
|
|
|
|
2000-09-29 12:26:34 +00:00
|
|
|
|
unsigned char GetStyleAttr (unsigned Addr);
|
2000-09-24 15:55:57 +00:00
|
|
|
|
/* Return the style attribute for the given address */
|
|
|
|
|
|
2000-09-29 12:26:34 +00:00
|
|
|
|
unsigned char GetLabelAttr (unsigned Addr);
|
|
|
|
|
/* Return the label attribute for the given address */
|
|
|
|
|
|
2000-09-24 20:54:49 +00:00
|
|
|
|
void DefOutOfRangeLabels (void);
|
|
|
|
|
/* Output any labels that are out of the loaded code range */
|
|
|
|
|
|
2000-09-24 15:55:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* End of attrtab.h */
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|