Completed the coding of da65's SEGMENT feature.

Before this commit, we could define segment ranges; but, the disassembler wouldn't do anything with those definitions.  Now, da65 will put ".segment" directives into its output.

Fixed da65's document.
This commit is contained in:
Greg King
2014-11-23 15:29:16 -05:00
parent 5b55fa4500
commit 0ee891c106
10 changed files with 261 additions and 174 deletions

View File

@@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 2000-2006 Ullrich von Bassewitz */
/* R<EFBFBD>merstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* (C) 2000-2014, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@@ -47,33 +47,34 @@
typedef enum attr_t {
/* Styles */
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 */
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 = 0x0000, /* No label for this address */
atExtLabel = 0x0010, /* External label */
atIntLabel = 0x0020, /* Internally generated label */
atDepLabel = 0x0040, /* Dependent label */
atUnnamedLabel = 0x0080, /* Unnamed 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 */
atLabelDefined = 0x0100, /* True if we defined the label */
atLabelDefined = 0x0100, /* True if we defined the label */
atStyleMask = 0x000F, /* Output style */
atLabelMask = 0x00F0, /* Label information */
atStyleMask = 0x000F, /* Output style */
atLabelMask = 0x00F0, /* Label information */
/* Segment */
atSegment = 0x0100, /* Code is in a segment */
atSegmentChange = 0x0200, /* Either segment start or segment end */
atSegment = 0x0100, /* Code is in a segment */
atSegmentEnd = 0x0200, /* Segment end */
atSegmentStart = 0x0400, /* Segment start */
} attr_t;
@@ -87,11 +88,20 @@ typedef enum attr_t {
void AddrCheck (unsigned Addr);
/* Check if the given address has a valid range */
attr_t GetAttr (unsigned Addr);
/* Return the attribute for the given address */
int SegmentDefined (unsigned Start, unsigned End);
/* Return true if the atSegment bit is set somewhere in the given range */
int IsSegmentEnd (unsigned Addr);
/* Return true if a segment ends at the given address */
int IsSegmentStart (unsigned Addr);
/* Return true if a segment starts at the given address */
int HaveSegmentChange (unsigned Addr);
/* Return true if the segment change attribute is set for the given address */
/* Return true if the segment change attributes are set for the given address */
unsigned GetGranularity (attr_t Style);
/* Get the granularity for the given style */
@@ -102,9 +112,6 @@ void MarkRange (unsigned Start, unsigned End, attr_t Attr);
void MarkAddr (unsigned Addr, attr_t Attr);
/* Mark an address with an attribute */
attr_t GetAttr (unsigned Addr);
/* Return the attribute for the given address */
attr_t GetStyleAttr (unsigned Addr);
/* Return the style attribute for the given address */
@@ -114,5 +121,4 @@ attr_t GetLabelAttr (unsigned Addr);
/* End of attrtab.h */
#endif