diff --git a/src/asm/asmy.y b/src/asm/asmy.y index 901b500d..a6e5ec04 100644 --- a/src/asm/asmy.y +++ b/src/asm/asmy.y @@ -1243,7 +1243,13 @@ const : T_ID { $$ = sym_GetConstantValue($1); } | T_NUMBER { $$ = $1; } | T_OP_HIGH '(' const ')' { $$ = ($3 >> 8) & 0xFF; } | T_OP_LOW '(' const ')' { $$ = $3 & 0xFF; } - | string { $$ = str2int($1); } + | string + { + char *s = $1; + int32_t length = charmap_Convert(&s); + $$ = str2int2(s, length); + free(s); + } | T_OP_LOGICNOT const %prec NEG { $$ = !$2; } | const T_OP_LOGICOR const { $$ = $1 || $3; } | const T_OP_LOGICAND const { $$ = $1 && $3; } diff --git a/test/asm/equ-charmap.asm b/test/asm/equ-charmap.asm new file mode 100644 index 00000000..a1e8aa87 --- /dev/null +++ b/test/asm/equ-charmap.asm @@ -0,0 +1,4 @@ +SECTION "sec", ROM0 + charmap "A", 1 +_A_ EQU "A" + db _A_ diff --git a/test/asm/equ-charmap.out b/test/asm/equ-charmap.out new file mode 100644 index 00000000..e69de29b diff --git a/test/asm/equ-charmap.out.bin b/test/asm/equ-charmap.out.bin new file mode 100644 index 00000000..6b2aaa76 --- /dev/null +++ b/test/asm/equ-charmap.out.bin @@ -0,0 +1 @@ + \ No newline at end of file