Files
rgbds/test/asm/string-formatting.asm
Sylvie 6b8d33529e Improve string/interpolation formatting (#1491)
- The '#' component for type 's' now escapes the string characters
- The '#' component for type 'f' now prints a precision suffix
- The new 'q' component specifies a precision value
2024-09-01 12:54:26 -04:00

18 lines
373 B
NASM

def n equ 300
def m equ -42
def f equ -123.0456
def pi equ 3.14159
def s equs "hello"
def t equs "\"\\t\" is '\t'"
println "<{ -6d:n}> <{+06u:n}> <{5x:n}> <{#16b:n}>"
println "<{u:m}> <{+3d:m}> <{#016o:m}>"
println "<{f:pi}> <{06.f:f}> <{.10f:f}>"
println "\"{#-20s:t}\", \"{#20s:t}\", \"{20s:t}\""
macro foo
println "\1 <{\1}>"
endm
foo -6d:n ; space is trimmed