mirror of
https://github.com/cc65/cc65.git
synced 2025-02-07 04:31:38 +00:00
commit
36a56faa14
@ -522,6 +522,11 @@ following attributes are recognized:
|
|||||||
|
|
||||||
</descrip>
|
</descrip>
|
||||||
|
|
||||||
|
<tag><tt>UNIT</tt></tag>
|
||||||
|
Split the table into sections of this size. For example, if you have a
|
||||||
|
ByteTable of size 48, but it has logical groups of size 16, specifying
|
||||||
|
16 for UNIT adds newlines after every 16 bytes. UNIT is always in bytes.
|
||||||
|
|
||||||
<tag><tt>ADDRMODE</tt></tag>
|
<tag><tt>ADDRMODE</tt></tag>
|
||||||
When disassembling 65816 code, this specifies the M and X flag states
|
When disassembling 65816 code, this specifies the M and X flag states
|
||||||
for this range. It's a string argument of the form "mx", capital letters
|
for this range. It's a string argument of the form "mx", capital letters
|
||||||
|
@ -71,6 +71,9 @@ typedef enum attr_t {
|
|||||||
atSegmentEnd = 0x0200, /* Segment end */
|
atSegmentEnd = 0x0200, /* Segment end */
|
||||||
atSegmentStart = 0x0400, /* Segment start */
|
atSegmentStart = 0x0400, /* Segment start */
|
||||||
|
|
||||||
|
/* Table unit separator */
|
||||||
|
atTableUnit = 0x0800,
|
||||||
|
|
||||||
/* 65816 addressing mode */
|
/* 65816 addressing mode */
|
||||||
atMem8 = 0x1000, /* M flag enabled, 8-bit */
|
atMem8 = 0x1000, /* M flag enabled, 8-bit */
|
||||||
atMem16 = 0x2000, /* M flag disabled, 16-bit */
|
atMem16 = 0x2000, /* M flag disabled, 16-bit */
|
||||||
@ -79,7 +82,7 @@ typedef enum attr_t {
|
|||||||
|
|
||||||
atStyleMask = 0x000F, /* Output style */
|
atStyleMask = 0x000F, /* Output style */
|
||||||
atLabelMask = 0x00F0, /* Label information */
|
atLabelMask = 0x00F0, /* Label information */
|
||||||
atSegmentMask = 0x0F00, /* Segment information */
|
atSegmentMask = 0x0700, /* Segment information */
|
||||||
at65816Mask = 0xF000, /* 65816 information */
|
at65816Mask = 0xF000, /* 65816 information */
|
||||||
|
|
||||||
} attr_t;
|
} attr_t;
|
||||||
|
@ -70,7 +70,7 @@ static unsigned GetSpan (attr_t Style)
|
|||||||
if ((Attr & atStyleMask) != Style) {
|
if ((Attr & atStyleMask) != Style) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((Attr & (atSegmentStart | atSegmentEnd))) {
|
if ((Attr & (atSegmentStart | atSegmentEnd | atTableUnit))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++Count;
|
++Count;
|
||||||
|
@ -528,6 +528,7 @@ static void RangeSection (void)
|
|||||||
{ "START", INFOTOK_START },
|
{ "START", INFOTOK_START },
|
||||||
{ "TYPE", INFOTOK_TYPE },
|
{ "TYPE", INFOTOK_TYPE },
|
||||||
{ "ADDRMODE", INFOTOK_ADDRMODE },
|
{ "ADDRMODE", INFOTOK_ADDRMODE },
|
||||||
|
{ "UNIT", INFOTOK_UNIT },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const IdentTok TypeDefs[] = {
|
static const IdentTok TypeDefs[] = {
|
||||||
@ -552,6 +553,7 @@ static void RangeSection (void)
|
|||||||
tName = 0x08,
|
tName = 0x08,
|
||||||
tComment = 0x10,
|
tComment = 0x10,
|
||||||
tAddrMode = 0x20,
|
tAddrMode = 0x20,
|
||||||
|
tUnit = 0x40,
|
||||||
tNeeded = (tStart | tEnd | tType)
|
tNeeded = (tStart | tEnd | tType)
|
||||||
};
|
};
|
||||||
unsigned Attributes = tNone;
|
unsigned Attributes = tNone;
|
||||||
@ -564,6 +566,7 @@ static void RangeSection (void)
|
|||||||
char* Name = 0;
|
char* Name = 0;
|
||||||
char* Comment = 0;
|
char* Comment = 0;
|
||||||
unsigned MemberSize = 0;
|
unsigned MemberSize = 0;
|
||||||
|
unsigned Unit = 0;
|
||||||
|
|
||||||
|
|
||||||
/* Skip the token */
|
/* Skip the token */
|
||||||
@ -682,6 +685,15 @@ static void RangeSection (void)
|
|||||||
InfoNextTok ();
|
InfoNextTok ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case INFOTOK_UNIT:
|
||||||
|
AddAttr ("UNIT", &Attributes, tUnit);
|
||||||
|
InfoNextTok ();
|
||||||
|
InfoAssureInt ();
|
||||||
|
InfoRangeCheck (0x0002, 0xFFFF);
|
||||||
|
Unit = InfoIVal;
|
||||||
|
InfoNextTok ();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Internal ("Unexpected token: %u", InfoTok);
|
Internal ("Unexpected token: %u", InfoTok);
|
||||||
}
|
}
|
||||||
@ -705,6 +717,26 @@ static void RangeSection (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Only tables support unit sizes */
|
||||||
|
if ((Attributes & tUnit) &&
|
||||||
|
Type != atAddrTab &&
|
||||||
|
Type != atByteTab &&
|
||||||
|
Type != atDByteTab &&
|
||||||
|
Type != atDWordTab &&
|
||||||
|
Type != atRtsTab &&
|
||||||
|
Type != atTextTab &&
|
||||||
|
Type != atWordTab) {
|
||||||
|
InfoError ("Only table types support unit size");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Mark each unit separator */
|
||||||
|
if (Attributes & tUnit) {
|
||||||
|
unsigned i;
|
||||||
|
for (i = Start; i < End; i += Unit) {
|
||||||
|
MarkAddr(i, atTableUnit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Start must be less than end */
|
/* Start must be less than end */
|
||||||
if (Start > End) {
|
if (Start > End) {
|
||||||
InfoError ("Start value must not be greater than end value");
|
InfoError ("Start value must not be greater than end value");
|
||||||
|
@ -91,6 +91,7 @@ typedef enum token_t {
|
|||||||
INFOTOK_END,
|
INFOTOK_END,
|
||||||
INFOTOK_TYPE,
|
INFOTOK_TYPE,
|
||||||
INFOTOK_ADDRMODE,
|
INFOTOK_ADDRMODE,
|
||||||
|
INFOTOK_UNIT,
|
||||||
|
|
||||||
INFOTOK_CODE,
|
INFOTOK_CODE,
|
||||||
INFOTOK_BYTETAB,
|
INFOTOK_BYTETAB,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user