mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 00:29:31 +00:00
Merge pull request #1885 from clbr/da65-range-end
Allow specifying range end as a size
This commit is contained in:
commit
eede412959
@ -461,7 +461,8 @@ following attributes are recognized:
|
|||||||
<tag><tt>END</tt></tag>
|
<tag><tt>END</tt></tag>
|
||||||
This gives the end address of the range. The end address is inclusive, that
|
This gives the end address of the range. The end address is inclusive, that
|
||||||
means, it is part of the range. Of course, it may not be smaller than the
|
means, it is part of the range. Of course, it may not be smaller than the
|
||||||
start address.
|
start address. Optionally, the end may be given as a decimal offset instead
|
||||||
|
of an absolute address, "+3", to specify it as a size.
|
||||||
|
|
||||||
<tag><tt>NAME</tt></tag>
|
<tag><tt>NAME</tt></tag>
|
||||||
This is a convenience attribute. It takes a string argument and will cause
|
This is a convenience attribute. It takes a string argument and will cause
|
||||||
|
@ -592,9 +592,19 @@ static void RangeSection (void)
|
|||||||
case INFOTOK_END:
|
case INFOTOK_END:
|
||||||
AddAttr ("END", &Attributes, tEnd);
|
AddAttr ("END", &Attributes, tEnd);
|
||||||
InfoNextTok ();
|
InfoNextTok ();
|
||||||
InfoAssureInt ();
|
|
||||||
InfoRangeCheck (0x0000, 0xFFFF);
|
if (InfoTok == INFOTOK_OFFSET_INTCON) {
|
||||||
End = InfoIVal;
|
InfoRangeCheck (0x0000, 0xFFFF);
|
||||||
|
if (!(Attributes & tStart))
|
||||||
|
InfoError ("When using End with an offset, Start must be specified before");
|
||||||
|
End = Start + InfoIVal - 1;
|
||||||
|
if (End > 0xFFFF)
|
||||||
|
InfoError ("Range error");
|
||||||
|
} else {
|
||||||
|
InfoAssureInt ();
|
||||||
|
InfoRangeCheck (0x0000, 0xFFFF);
|
||||||
|
End = InfoIVal;
|
||||||
|
}
|
||||||
InfoNextTok ();
|
InfoNextTok ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -372,6 +372,14 @@ Again:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Decimal number offset? */
|
||||||
|
if (C == '+') {
|
||||||
|
NextChar ();
|
||||||
|
InfoIVal = GetDecimalToken ();
|
||||||
|
InfoTok = INFOTOK_OFFSET_INTCON;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Other characters */
|
/* Other characters */
|
||||||
switch (C) {
|
switch (C) {
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
typedef enum token_t {
|
typedef enum token_t {
|
||||||
INFOTOK_NONE,
|
INFOTOK_NONE,
|
||||||
INFOTOK_INTCON,
|
INFOTOK_INTCON,
|
||||||
|
INFOTOK_OFFSET_INTCON,
|
||||||
INFOTOK_STRCON,
|
INFOTOK_STRCON,
|
||||||
INFOTOK_CHARCON,
|
INFOTOK_CHARCON,
|
||||||
INFOTOK_IDENT,
|
INFOTOK_IDENT,
|
||||||
|
Loading…
Reference in New Issue
Block a user