Support SIZEOF(reg) to distinguish 8- and 16-bit registers (#1758)

This commit is contained in:
Rangi
2025-07-17 15:49:28 -04:00
committed by GitHub
parent 0c96234532
commit 4c8724899b
3 changed files with 62 additions and 0 deletions

30
test/asm/sizeof-reg.asm Normal file
View File

@@ -0,0 +1,30 @@
assert sizeof(a) == 1
assert sizeof(b) == 1
assert sizeof(c) == 1
assert sizeof(d) == 1
assert sizeof(e) == 1
assert sizeof(h) == 1
assert sizeof(l) == 1
assert sizeof([bc]) == 1
assert sizeof([de]) == 1
assert sizeof([hl]) == 1
assert sizeof([hli]) == 1
assert sizeof([hl+]) == 1
assert sizeof([hld]) == 1
assert sizeof([hl-]) == 1
assert sizeof(af) == 2
assert sizeof(bc) == 2
assert sizeof(de) == 2
assert sizeof(hl) == 2
assert sizeof(sp) == 2
assert sizeof(high(af)) == 1
assert sizeof(high(bc)) == 1
assert sizeof(low(bc)) == 1
assert sizeof(high(de)) == 1
assert sizeof(low(de)) == 1
assert sizeof(high(hl)) == 1
assert sizeof(low(hl)) == 1