Skip to content

Commit 56c0604

Browse files
committed
fix: 0xff hexa not supported in asm
1 parent b710f08 commit 56c0604

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/zxbasm/asmlex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def t_CHAR(self, t):
263263
return t
264264

265265
def t_HEXA(self, t):
266-
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])*)"
266+
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])*)"
267267

268268
if t.value[:2] == "0x":
269269
t.value = t.value[2:] # Remove initial 0x

tests/functional/hex_num1.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ld a, 0xff

tests/functional/hex_num1.bin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
>�

0 commit comments

Comments
 (0)