From 56c0604819659dc4b28927302db26661adb2b5cd Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Wed, 8 Nov 2023 00:05:11 +0100 Subject: [PATCH] fix: 0xff hexa not supported in asm --- src/zxbasm/asmlex.py | 2 +- tests/functional/hex_num1.asm | 1 + tests/functional/hex_num1.bin | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 tests/functional/hex_num1.asm create mode 100644 tests/functional/hex_num1.bin diff --git a/src/zxbasm/asmlex.py b/src/zxbasm/asmlex.py index 496963d90..d04dc81c8 100755 --- a/src/zxbasm/asmlex.py +++ b/src/zxbasm/asmlex.py @@ -263,7 +263,7 @@ def t_CHAR(self, t): return t def t_HEXA(self, t): - r"([0-9](_?[0-9a-fA-F])*[hH])|(\$[0-9a-fA-F](_?[0-9a-fA-F])*)|(0x[0-9a-fA-F](_?[0-9a-dA-F])*)" + r"([0-9](_?[0-9a-fA-F])*[hH])|(\$[0-9a-fA-F](_?[0-9a-fA-F])*)|(0x[0-9a-fA-F](_?[0-9a-fA-F])*)" if t.value[:2] == "0x": t.value = t.value[2:] # Remove initial 0x diff --git a/tests/functional/hex_num1.asm b/tests/functional/hex_num1.asm new file mode 100644 index 000000000..f5ffae764 --- /dev/null +++ b/tests/functional/hex_num1.asm @@ -0,0 +1 @@ +ld a, 0xff diff --git a/tests/functional/hex_num1.bin b/tests/functional/hex_num1.bin new file mode 100644 index 000000000..3d44f85d7 --- /dev/null +++ b/tests/functional/hex_num1.bin @@ -0,0 +1 @@ +>ÿ \ No newline at end of file