From 3623638be70502863816d40f9acb2f020d4c9c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ni=C3=B1o=20D=C3=ADaz?= Date: Thu, 22 Feb 2018 21:23:25 +0000 Subject: [PATCH] Fix HIGH() and LOW() for constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HIGH() and LOW() only worked with labels and register pairs. Signed-off-by: Antonio Niño Díaz --- src/asm/asmy.y | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/asm/asmy.y b/src/asm/asmy.y index 6199f064..561d5425 100644 --- a/src/asm/asmy.y +++ b/src/asm/asmy.y @@ -1234,6 +1234,8 @@ uconst : const 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); } | T_OP_LOGICNOT const %prec NEG { $$ = !$2; } | const T_OP_LOGICOR const { $$ = $1 || $3; }