So far I've found it very buggy - even for simple things:
.intel_syntax noprefix
.globl WinMainCRTStartup
WinMainCRTStartup:
pop rax
xor ecx,ecx
lea rdx,[rip + _message]
lea r8,[rip + _caption]
mov r9,rcx
call MessageBoxW
xchg ecx,eax
call ExitProcess
int3
.macro wchars name:req foo:vararg
.align 2,0
\name :
.irpc bar,"\foo"
.ifnc \bar\bar,""
.ascii "\bar"
.byte 0
.else # without this else cc1as generates incorrect output
.print "\\bar"
.endif
.endr
.byte 0,0
.endmacro
.data
wchars _caption Win64 assembly program
wchars _message Hello World!
# commands for the linker
.section .drectve,"yn"
.ascii " /SUBSYSTEM:WINDOWS"
.ascii " /DEFAULTLIB:kernel32.lib"
.ascii " /DEFAULTLIB:user32.lib"
Build with...
clang -cc1as -triple x86_64-pc-windows-msvc19.28.29910 -filetype obj -o thisfile.obj thisfile.s
lld-link -out:thisfile.exe thisfile.obj
I'm kind of leery about trying anything more challenging. There doesn't appear to be a directive to output wide chars, or any UTF-8 support of any kind. All strings must be escapable ASCII - otherwise they are interpreted as symbols.