Merge pull request #2104 from Movax12/remove-feature-requirement-addrsize
ca65: Remove .feature requirement for .addrsize
This commit is contained in:
@@ -1409,10 +1409,6 @@ either a string or an expression value.
|
|||||||
.endmacro
|
.endmacro
|
||||||
</verb></tscreen>
|
</verb></tscreen>
|
||||||
|
|
||||||
This command is new and must be enabled with the <tt/.FEATURE addrsize/ command.
|
|
||||||
|
|
||||||
See: <tt><ref id=".FEATURE" name=".FEATURE"></tt>
|
|
||||||
|
|
||||||
|
|
||||||
<sect1><tt>.BANK</tt><label id=".BANK"><p>
|
<sect1><tt>.BANK</tt><label id=".BANK"><p>
|
||||||
|
|
||||||
@@ -2795,12 +2791,6 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".CHARMAP" name=".CH
|
|||||||
|
|
||||||
<descrip>
|
<descrip>
|
||||||
|
|
||||||
<tag><tt>addrsize</tt><label id="addrsize"></tag>
|
|
||||||
|
|
||||||
Enables the .ADDRSIZE pseudo function. This function is experimental and not enabled by default.
|
|
||||||
|
|
||||||
See also: <tt><ref id=".ADDRSIZE" name=".ADDRSIZE"></tt>
|
|
||||||
|
|
||||||
<tag><tt>at_in_identifiers</tt><label id="at_in_identifiers"></tag>
|
<tag><tt>at_in_identifiers</tt><label id="at_in_identifiers"></tag>
|
||||||
|
|
||||||
Accept the at character ('@') as a valid character in identifiers. The
|
Accept the at character ('@') as a valid character in identifiers. The
|
||||||
|
|||||||
@@ -118,7 +118,6 @@ void SetFeature (feature_t Feature, unsigned char On)
|
|||||||
case FEAT_C_COMMENTS: CComments = On; break;
|
case FEAT_C_COMMENTS: CComments = On; break;
|
||||||
case FEAT_FORCE_RANGE: ForceRange = On; break;
|
case FEAT_FORCE_RANGE: ForceRange = On; break;
|
||||||
case FEAT_UNDERLINE_IN_NUMBERS: UnderlineInNumbers= On; break;
|
case FEAT_UNDERLINE_IN_NUMBERS: UnderlineInNumbers= On; break;
|
||||||
case FEAT_ADDRSIZE: AddrSize = On; break;
|
|
||||||
case FEAT_BRACKET_AS_INDIRECT: BracketAsIndirect = On; break;
|
case FEAT_BRACKET_AS_INDIRECT: BracketAsIndirect = On; break;
|
||||||
case FEAT_STRING_ESCAPES: StringEscapes = On; break;
|
case FEAT_STRING_ESCAPES: StringEscapes = On; break;
|
||||||
case FEAT_LONG_JSR_JMP_RTS: LongJsrJmpRts = On; break;
|
case FEAT_LONG_JSR_JMP_RTS: LongJsrJmpRts = On; break;
|
||||||
|
|||||||
@@ -85,5 +85,4 @@ unsigned char OrgPerSeg = 0; /* Make .org local to current seg */
|
|||||||
unsigned char CComments = 0; /* Allow C like comments */
|
unsigned char CComments = 0; /* Allow C like comments */
|
||||||
unsigned char ForceRange = 0; /* Force values into expected range */
|
unsigned char ForceRange = 0; /* Force values into expected range */
|
||||||
unsigned char UnderlineInNumbers = 0; /* Allow underlines in numbers */
|
unsigned char UnderlineInNumbers = 0; /* Allow underlines in numbers */
|
||||||
unsigned char AddrSize = 0; /* Allow .ADDRSIZE function */
|
|
||||||
unsigned char BracketAsIndirect = 0; /* Use '[]' not '()' for indirection */
|
unsigned char BracketAsIndirect = 0; /* Use '[]' not '()' for indirection */
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ extern unsigned char OrgPerSeg; /* Make .org local to current seg */
|
|||||||
extern unsigned char CComments; /* Allow C like comments */
|
extern unsigned char CComments; /* Allow C like comments */
|
||||||
extern unsigned char ForceRange; /* Force values into expected range */
|
extern unsigned char ForceRange; /* Force values into expected range */
|
||||||
extern unsigned char UnderlineInNumbers; /* Allow underlines in numbers */
|
extern unsigned char UnderlineInNumbers; /* Allow underlines in numbers */
|
||||||
extern unsigned char AddrSize; /* Allow .ADDRSIZE function */
|
|
||||||
extern unsigned char BracketAsIndirect; /* Use '[]' not '()' for indirection */
|
extern unsigned char BracketAsIndirect; /* Use '[]' not '()' for indirection */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1043,6 +1043,11 @@ static void DoFeature (void)
|
|||||||
ErrorSkip ("Invalid feature: '%m%p'", &CurTok.SVal);
|
ErrorSkip ("Invalid feature: '%m%p'", &CurTok.SVal);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Feature == FEAT_ADDRSIZE) {
|
||||||
|
Warning (1, "Deprecated feature: '.feature addrsize'. Pseudo function .addrsize is always available.");
|
||||||
|
}
|
||||||
|
|
||||||
NextTok ();
|
NextTok ();
|
||||||
|
|
||||||
/* Optional +/- or ON/OFF */
|
/* Optional +/- or ON/OFF */
|
||||||
|
|||||||
@@ -748,24 +748,7 @@ static token_t FindDotKeyword (void)
|
|||||||
R = bsearch (&K, DotKeywords, sizeof (DotKeywords) / sizeof (DotKeywords [0]),
|
R = bsearch (&K, DotKeywords, sizeof (DotKeywords) / sizeof (DotKeywords [0]),
|
||||||
sizeof (DotKeywords [0]), CmpDotKeyword);
|
sizeof (DotKeywords [0]), CmpDotKeyword);
|
||||||
if (R != 0) {
|
if (R != 0) {
|
||||||
|
|
||||||
/* By default, disable any somewhat experiemental DotKeyword. */
|
|
||||||
|
|
||||||
switch (R->Tok) {
|
|
||||||
|
|
||||||
case TOK_ADDRSIZE:
|
|
||||||
/* Disallow .ADDRSIZE function by default */
|
|
||||||
if (AddrSize == 0) {
|
|
||||||
return TOK_NONE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return R->Tok;
|
return R->Tok;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return TOK_NONE;
|
return TOK_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
32
test/asm/val/addrsize.s
Normal file
32
test/asm/val/addrsize.s
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
; test .addrsize and ensure .feature addrsize is allowed, but inactive
|
||||||
|
|
||||||
|
.export _main
|
||||||
|
|
||||||
|
.segment "ZEROPAGE"
|
||||||
|
zplabel:
|
||||||
|
|
||||||
|
.segment "CODE"
|
||||||
|
abslabel:
|
||||||
|
|
||||||
|
; exit with 0
|
||||||
|
|
||||||
|
_main:
|
||||||
|
lda #0
|
||||||
|
tax
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
.assert .addrsize(zplabel) = 1, error, ".addrsize 1 expected for ZEROPAGE"
|
||||||
|
.assert .addrsize(abslabel) = 2, error, ".addrsize 2 expected for absolute"
|
||||||
|
|
||||||
|
.feature addrsize
|
||||||
|
.assert .addrsize(zplabel) = 1, error, ".addrsize 1 expected for ZEROPAGE"
|
||||||
|
.assert .addrsize(abslabel) = 2, error, ".addrsize 2 expected for absolute"
|
||||||
|
|
||||||
|
.feature addrsize +
|
||||||
|
.assert .addrsize(zplabel) = 1, error, ".addrsize 1 expected for ZEROPAGE"
|
||||||
|
.assert .addrsize(abslabel) = 2, error, ".addrsize 2 expected for absolute"
|
||||||
|
|
||||||
|
.feature addrsize -
|
||||||
|
.assert .addrsize(zplabel) = 1, error, ".addrsize 1 expected for ZEROPAGE"
|
||||||
|
.assert .addrsize(abslabel) = 2, error, ".addrsize 2 expected for absolute"
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
zplabel:
|
zplabel:
|
||||||
|
|
||||||
.segment "CODE"
|
.segment "CODE"
|
||||||
abslabel:
|
|
||||||
|
|
||||||
; exit with 0
|
; exit with 0
|
||||||
|
|
||||||
@@ -17,13 +16,6 @@ _main:
|
|||||||
tax
|
tax
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
.feature addrsize +
|
|
||||||
.assert .addrsize(zplabel) = 1, error, ".addrsize 1 expected for ZEROPAGE"
|
|
||||||
.assert .addrsize(abslabel) = 2, error, ".addrsize 2 expected for absolute"
|
|
||||||
.feature addrsize -
|
|
||||||
|
|
||||||
|
|
||||||
.feature at_in_identifiers on
|
.feature at_in_identifiers on
|
||||||
ident@with@at:
|
ident@with@at:
|
||||||
rts
|
rts
|
||||||
|
|||||||
Reference in New Issue
Block a user