Merge pull request #2791 from mrdudz/fix2789

Fix2789
This commit is contained in:
Bob Andrews
2025-07-11 19:00:01 +02:00
committed by GitHub
2 changed files with 44 additions and 1 deletions

View File

@@ -642,7 +642,7 @@ static void DoCharMap (void)
/* Read the index as numerical value */
Index = ConstExpression ();
if (IsByteRange (Index)) {
if (!IsByteRange (Index)) {
/* Value out of range */
ErrorSkip ("Index must be in byte range");
return;

43
test/asm/val/charmap.s Normal file
View File

@@ -0,0 +1,43 @@
.setcpu "6502"
.import _exit
.export _main
.charmap $41, 0
.charmap $42, 1
.charmap $43, 2
mapped:
.byte "ABC"
.include "ascii_charmap.inc"
ascii:
.byte "ABC"
_main:
ldx #$01
lda mapped+0
cmp #0
bne error
lda mapped+1
cmp #1
bne error
lda mapped+2
cmp #2
bne error
lda ascii+0
cmp #$41
bne error
lda ascii+1
cmp #$42
bne error
lda ascii+2
cmp #$43
bne error
ldx #$00
error:
txa
jmp _exit