mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 11:12:07 +00:00
Implement BITWIDTH and TZCOUNT functions (#1450)
This commit is contained in:
11
test/asm/bit-functions.asm
Normal file
11
test/asm/bit-functions.asm
Normal file
@@ -0,0 +1,11 @@
|
||||
assert BITWIDTH(0) == 0
|
||||
assert BITWIDTH(42) == 6
|
||||
assert BITWIDTH(-1) == 32
|
||||
assert BITWIDTH($80000000) == 32
|
||||
|
||||
assert TZCOUNT(0) == 32
|
||||
assert TZCOUNT(42) == 1
|
||||
assert TZCOUNT(-1) == 0
|
||||
assert TZCOUNT($80000000) == 31
|
||||
|
||||
assert TZCOUNT(1.0) == 16
|
||||
@@ -27,3 +27,6 @@ db @ <= 7
|
||||
dw @ << 1
|
||||
dw @ >> 1
|
||||
dw @ >>> 1
|
||||
|
||||
db BITWIDTH(@)
|
||||
db TZCOUNT(@)
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user