Compare commits

...

11 Commits

Author SHA1 Message Date
Bob Andrews
c720c3c485 Merge pull request #2910 from Fabrizio-Caruso/patch-1
Some checks failed
Windows Test Scheduled / Build, Test (Windows MSVC) (push) Has been cancelled
Fix typo in Watara entry in README
2025-12-03 22:24:14 +01:00
Fabrizio Caruso
10297ba637 Fix typo in Watara entry in README 2025-12-03 21:54:32 +01:00
Bob Andrews
36f00f9886 Merge pull request #2907 from colinleroy/decomp-more-info
Mention where decompressors stats come from
2025-12-03 21:32:22 +01:00
Colin Leroy-Mira
e01a608863 Mention where decompressors stats come from 2025-12-01 13:30:26 +01:00
Bob Andrews
dbcfa91089 Merge pull request #2863 from kugelfuhr/kugelfuhr/fix-2859
Fix broken boolean not operator in ca65
2025-11-18 16:39:08 +01:00
Kugel Fuhr
1924e4cc63 Added a test for #2859. 2025-11-18 14:38:10 +01:00
Kugel Fuhr
c4cd575331 Fix parsing boolean not (.not/!). 2025-11-18 14:35:29 +01:00
Bob Andrews
640206696f Merge pull request #2855 from picocomputer/master
Update RP6502 in README
2025-11-14 23:49:48 +01:00
Bob Andrews
3d7e3884e4 Merge pull request #2856 from kugelfuhr/kugelfuhr/fix-2854
Corrected a typo in the description of .set
2025-11-09 19:10:26 +01:00
Kugel Fuhr
aa73c03f6a Corrected a typo in the description of .set. Fixes #2854. 2025-11-09 17:25:57 +01:00
rumbledethumps
1d219395f2 Update RP6502 in README 2025-11-07 13:11:47 -08:00
5 changed files with 56 additions and 47 deletions

View File

@@ -36,8 +36,8 @@ the [cc65 web site](https://cc65.github.io):
| Ohio Scientific | OSI C1P |
| MOS Technology, Inc. | KIM-1 |
| NEC | PC Engine (PCE) |
| Dr. Jozo Dujmović | Picocomputer (RP6502) |
| Watara | Watura/QuickShot Supervision |
| Rumbledethumps | Picocomputer 6502 (RP6502) |
| Watara | Watara/QuickShot Supervision |
| Synertek | SYM-1 |
| USSR | Agat-7/9 |
@@ -74,7 +74,7 @@ enhanced by James E. Hendrix.
* [Stephan Mühlstrasser](https://github.com/smuehlst): osic1p target
* [Wayne Parham](https://github.com/WayneParham): Sym-1 target
* [Dave Plummer](https://github.com/davepl): KIM-1 target
* [rumbledethumps](https://github.com/rumbledethumps): Picocomputer target
* [Rumbledethumps](https://github.com/rumbledethumps): RP6502 target
*(The above list is incomplete, if you feel left out - please speak up or add yourself in a PR)*

View File

@@ -934,7 +934,7 @@ it is used. It uses the <tt><ref id=".SPRINTF" name=".SPRINTF"></tt> function
and a numeric variable named <tt>lcount</tt>.
<tscreen><verb>
.lcount .set 0 ; Initialize the counter
lcount .set 0 ; Initialize the counter
.macro genlab
.ident (.sprintf ("L%04X", lcount)):

View File

@@ -146,7 +146,10 @@ so that decompressing does not overwrite the end of the compressed data too soon
<sect>Which decompressor to choose<p>
The best decompressor depends on your use-case and whether you favor size or
speed. This table allows for a simple comparison.
speed. This table allows for a simple comparison. The numbers come from
arbitrary real-world data (graphics and code from the Apple II Shufflepuck
game) in order to give an overview of what to expect from the different
algorithms.
Decompression speed is the number of uncompressed bytes per second at 1MHz.
<table><tabular ca="rrrr">

View File

@@ -146,7 +146,7 @@ static void FreeExprNode (ExprNode* E)
static ExprNode* Expr0 (void);
static ExprNode* Expr1 (void);
@@ -1106,6 +1106,18 @@ static ExprNode* Factor (void)
NextTok ();
break;
case TOK_BOOLNOT:
NextTok ();
L = Expr1 ();
if (IsEasyConst (L, &Val)) {
FreeExpr (L);
N = GenLiteralExpr (!Val);
} else {
N = NewExprNode (EXPR_BOOLNOT);
N->Left = L;
}
break;
case TOK_PLUS:
NextTok ();
N = Factor ();
@@ -1159,7 +1171,7 @@ static ExprNode* Factor (void)
case TOK_LPAREN:
NextTok ();
N = Expr0 ();
N = Expr1 ();
ConsumeRParen ();
break;
@@ -1652,51 +1664,12 @@ static ExprNode* Expr1 (void)
static ExprNode* Expr0 (void)
/* Boolean operators: NOT */
{
ExprNode* Root;
/* Handle booleans */
if (CurTok.Tok == TOK_BOOLNOT) {
long Val;
ExprNode* Left;
/* Skip the operator token */
NextTok ();
/* Read the argument */
Left = Expr0 ();
/* If the argument is const, evaluate it directly */
if (IsEasyConst (Left, &Val)) {
FreeExpr (Left);
Root = GenLiteralExpr (!Val);
} else {
Root = NewExprNode (EXPR_BOOLNOT);
Root->Left = Left;
}
} else {
/* Read left hand side */
Root = Expr1 ();
}
/* Return the expression tree we've created */
return Root;
}
ExprNode* Expression (void)
/* Evaluate an expression, build the expression tree on the heap and return
** a pointer to the root of the tree.
*/
{
return Expr0 ();
return Expr1 ();
}

33
test/asm/val/bug2859.s Normal file
View File

@@ -0,0 +1,33 @@
; Tests for the bug reported in #2859. Boolean not had the correct precedence
; (as specified in the docs) but worked only correctly at the start of a full
; expression.
; This one assembles ok since ! is at the start
.if !.defined(__DOCART__) && .defined(__C64__)
.byte 1
.endif
; This one assembles too since a parenthesis restarts a full expression
.if .defined(__C64__) && (!.defined(__DOCART__))
.byte 2
.endif
; This one doesn't work since ! is somewhere in between
.if .defined(__C64__) && !.defined(__DOCART__)
.byte 3
.endif
.import _exit
.export _main
; The following code is an indirect test for the precedence of .not.
; .not has the lowest precedence, so the expression that is loaded into A
; evaluates to zero. This has of course to be changed when the precedence
; of .not is changed.
_main:
lda #.not 0 + 1 ; Means: .not (0 + 1)
ldx #0
jmp _exit