Fix HIGH() and LOW() for constants

HIGH() and LOW() only worked with labels and register pairs.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2018-02-22 21:23:25 +00:00
parent 8ea3669a64
commit 3623638be7

View File

@@ -1234,6 +1234,8 @@ uconst : const
const : T_ID { $$ = sym_GetConstantValue($1); } const : T_ID { $$ = sym_GetConstantValue($1); }
| T_NUMBER { $$ = $1; } | T_NUMBER { $$ = $1; }
| T_OP_HIGH '(' const ')' { $$ = ($3 >> 8) & 0xFF; }
| T_OP_LOW '(' const ')' { $$ = $3 & 0xFF; }
| string { $$ = str2int($1); } | string { $$ = str2int($1); }
| T_OP_LOGICNOT const %prec NEG { $$ = !$2; } | T_OP_LOGICNOT const %prec NEG { $$ = !$2; }
| const T_OP_LOGICOR const { $$ = $1 || $3; } | const T_OP_LOGICOR const { $$ = $1 || $3; }