mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Implement opt Q for fixed-point precision, and q literals (e.g. 12.34q8) (#958)
Fixes #957 Co-authored-by: ISSOtm <eldredhabert0@gmail.com>
This commit is contained in:
18
test/asm/opt-Q.asm
Normal file
18
test/asm/opt-Q.asm
Normal file
@@ -0,0 +1,18 @@
|
||||
MACRO test
|
||||
PUSHO
|
||||
OPT Q\1
|
||||
print STRFMT("Q%4s", "\1")
|
||||
def n = 1.14159
|
||||
println STRFMT(" -> %032b", n)
|
||||
POPO
|
||||
ENDM
|
||||
|
||||
for x, 1, 32
|
||||
if x < 16
|
||||
test .{d:x}
|
||||
else
|
||||
test {d:x}
|
||||
endc
|
||||
endr
|
||||
test .0 ; error
|
||||
test 32 ; error
|
||||
Reference in New Issue
Block a user