Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.

Commit 652949f

Browse files
authored
Merge pull request cc65#2104 from Movax12/remove-feature-requirement-addrsize
ca65: Remove .feature requirement for .addrsize
2 parents 47ee29f + a058d4a commit 652949f

File tree

8 files changed

+37
-38
lines changed

8 files changed

+37
-38
lines changed

doc/ca65.sgml

-10
Original file line numberDiff line numberDiff line change
@@ -1409,10 +1409,6 @@ either a string or an expression value.
14091409
.endmacro
14101410
</verb></tscreen>
14111411

1412-
This command is new and must be enabled with the <tt/.FEATURE addrsize/ command.
1413-
1414-
See: <tt><ref id=".FEATURE" name=".FEATURE"></tt>
1415-
14161412

14171413
<sect1><tt>.BANK</tt><label id=".BANK"><p>
14181414

@@ -2795,12 +2791,6 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".CHARMAP" name=".CH
27952791

27962792
<descrip>
27972793

2798-
<tag><tt>addrsize</tt><label id="addrsize"></tag>
2799-
2800-
Enables the .ADDRSIZE pseudo function. This function is experimental and not enabled by default.
2801-
2802-
See also: <tt><ref id=".ADDRSIZE" name=".ADDRSIZE"></tt>
2803-
28042794
<tag><tt>at_in_identifiers</tt><label id="at_in_identifiers"></tag>
28052795

28062796
Accept the at character ('@') as a valid character in identifiers. The

src/ca65/feature.c

-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ void SetFeature (feature_t Feature, unsigned char On)
118118
case FEAT_C_COMMENTS: CComments = On; break;
119119
case FEAT_FORCE_RANGE: ForceRange = On; break;
120120
case FEAT_UNDERLINE_IN_NUMBERS: UnderlineInNumbers= On; break;
121-
case FEAT_ADDRSIZE: AddrSize = On; break;
122121
case FEAT_BRACKET_AS_INDIRECT: BracketAsIndirect = On; break;
123122
case FEAT_STRING_ESCAPES: StringEscapes = On; break;
124123
case FEAT_LONG_JSR_JMP_RTS: LongJsrJmpRts = On; break;

src/ca65/global.c

-1
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,4 @@ unsigned char OrgPerSeg = 0; /* Make .org local to current seg */
8585
unsigned char CComments = 0; /* Allow C like comments */
8686
unsigned char ForceRange = 0; /* Force values into expected range */
8787
unsigned char UnderlineInNumbers = 0; /* Allow underlines in numbers */
88-
unsigned char AddrSize = 0; /* Allow .ADDRSIZE function */
8988
unsigned char BracketAsIndirect = 0; /* Use '[]' not '()' for indirection */

src/ca65/global.h

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ extern unsigned char OrgPerSeg; /* Make .org local to current seg */
8787
extern unsigned char CComments; /* Allow C like comments */
8888
extern unsigned char ForceRange; /* Force values into expected range */
8989
extern unsigned char UnderlineInNumbers; /* Allow underlines in numbers */
90-
extern unsigned char AddrSize; /* Allow .ADDRSIZE function */
9190
extern unsigned char BracketAsIndirect; /* Use '[]' not '()' for indirection */
9291

9392

src/ca65/pseudo.c

+5
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,11 @@ static void DoFeature (void)
10431043
ErrorSkip ("Invalid feature: '%m%p'", &CurTok.SVal);
10441044
return;
10451045
}
1046+
1047+
if (Feature == FEAT_ADDRSIZE) {
1048+
Warning (1, "Deprecated feature: '.feature addrsize'. Pseudo function .addrsize is always available.");
1049+
}
1050+
10461051
NextTok ();
10471052

10481053
/* Optional +/- or ON/OFF */

src/ca65/scanner.c

-17
Original file line numberDiff line numberDiff line change
@@ -748,24 +748,7 @@ static token_t FindDotKeyword (void)
748748
R = bsearch (&K, DotKeywords, sizeof (DotKeywords) / sizeof (DotKeywords [0]),
749749
sizeof (DotKeywords [0]), CmpDotKeyword);
750750
if (R != 0) {
751-
752-
/* By default, disable any somewhat experiemental DotKeyword. */
753-
754-
switch (R->Tok) {
755-
756-
case TOK_ADDRSIZE:
757-
/* Disallow .ADDRSIZE function by default */
758-
if (AddrSize == 0) {
759-
return TOK_NONE;
760-
}
761-
break;
762-
763-
default:
764-
break;
765-
}
766-
767751
return R->Tok;
768-
769752
} else {
770753
return TOK_NONE;
771754
}

test/asm/val/addrsize.s

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
; test .addrsize and ensure .feature addrsize is allowed, but inactive
2+
3+
.export _main
4+
5+
.segment "ZEROPAGE"
6+
zplabel:
7+
8+
.segment "CODE"
9+
abslabel:
10+
11+
; exit with 0
12+
13+
_main:
14+
lda #0
15+
tax
16+
rts
17+
18+
19+
.assert .addrsize(zplabel) = 1, error, ".addrsize 1 expected for ZEROPAGE"
20+
.assert .addrsize(abslabel) = 2, error, ".addrsize 2 expected for absolute"
21+
22+
.feature addrsize
23+
.assert .addrsize(zplabel) = 1, error, ".addrsize 1 expected for ZEROPAGE"
24+
.assert .addrsize(abslabel) = 2, error, ".addrsize 2 expected for absolute"
25+
26+
.feature addrsize +
27+
.assert .addrsize(zplabel) = 1, error, ".addrsize 1 expected for ZEROPAGE"
28+
.assert .addrsize(abslabel) = 2, error, ".addrsize 2 expected for absolute"
29+
30+
.feature addrsize -
31+
.assert .addrsize(zplabel) = 1, error, ".addrsize 1 expected for ZEROPAGE"
32+
.assert .addrsize(abslabel) = 2, error, ".addrsize 2 expected for absolute"

test/asm/val/feature.s

-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
zplabel:
77

88
.segment "CODE"
9-
abslabel:
109

1110
; exit with 0
1211

@@ -17,13 +16,6 @@ _main:
1716
tax
1817
rts
1918

20-
21-
.feature addrsize +
22-
.assert .addrsize(zplabel) = 1, error, ".addrsize 1 expected for ZEROPAGE"
23-
.assert .addrsize(abslabel) = 2, error, ".addrsize 2 expected for absolute"
24-
.feature addrsize -
25-
26-
2719
.feature at_in_identifiers on
2820
ident@with@at:
2921
rts

0 commit comments

Comments
 (0)