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 */
@@ -66,6 +66,18 @@ void AddrCheck (unsigned Addr)
attr_t GetAttr (unsigned Addr)
/* Return the attribute for the given address */
{
/* Check the given address */
AddrCheck (Addr);
/* Return the attribute */
return AttrTab[Addr];
}
int SegmentDefined (unsigned Start, unsigned End)
/* Return true if the atSegment bit is set somewhere in the given range */
{
@@ -79,14 +91,26 @@ int SegmentDefined (unsigned Start, unsigned End)
int HaveSegmentChange (unsigned Addr)
/* Return true if the segment change attribute is set for the given address */
int IsSegmentEnd (unsigned Addr)
/* Return true if a segment ends at the given address */
{
/* Check the given address */
AddrCheck (Addr);
return (GetAttr (Addr) & atSegmentEnd) != 0x0000;
}
/* Return the attribute */
return (AttrTab[Addr] & atSegmentChange) != 0;
int IsSegmentStart (unsigned Addr)
/* Return true if a segment starts at the given address */
{
return (GetAttr (Addr) & atSegmentStart) != 0x0000;
}
int HaveSegmentChange (unsigned Addr)
/* Return true if the segment change attributes are set for the given address */
{
return (GetAttr (Addr) & (atSegmentStart | atSegmentEnd)) != 0x0000;
}
@@ -145,18 +169,6 @@ void MarkAddr (unsigned Addr, attr_t Attr)
attr_t GetAttr (unsigned Addr)
/* Return the attribute for the given address */
{
/* Check the given address */
AddrCheck (Addr);
/* Return the attribute */
return AttrTab[Addr];
}
attr_t GetStyleAttr (unsigned Addr)
/* Return the style attribute for the given address */
{