The example should build fine with the correct paths, correct link.exe paths etc.
However, there is a bug in UASM I noticed after looking at something mentioned above:
In some cases we can assemble instructions in the DATA section when we should not.
Extract from Win64_4.asm:
.CODE
main proc FRAME uses rbx rsi rdi
local dwWritten:DWORD
invoke GetStdHandle,STD_OUTPUT_HANDLE
mov rbx,rax
.DATA ; We are in the data section now but it will assemble happily the intel instructions
cstrr db "Hello, world",13,10,0
lea rsi, cstrr
lea rdi, CStr("Hello, world",13,10)
invoke lstrlen, rsi
mov edi, eax
invoke WriteConsoleA, rbx, rsi, edi, addr dwWritten, 0
ret
main endp
If we comment out
; lea rdi, CStr("Hello, world",13,10)
it will produce an error. Not the expected error but some error anyway.