macro du [arg]
{
local current,char
if arg eqtype ''
virtual at 0
db arg
count = $
end virtual
current = 0
while current < count
virtual at 0
db arg
load char byte from current
wide=char
virtual at 0
file 'utf16':char*2,2
load char word from 0
end virtual
current = current+1
if char <> 0
wide = char
if current < count
load char byte from current
wide=(wide+char)*2
virtual at 0
file 'utf16':wide,2
load wide word from 0
end virtual
else
wide = 0
end if
current = current + 1
end if
end virtual
dw wide
end while
else
dw arg
end if
}
struc du [args]
{
common label . word
du args
.size=$-.
}
; example of simplified Windows programming using complex macro features
include 'win32wx.inc' ; you can simply switch between win32ax, win32wx, win64ax and win64wx here
include 'ENCODING/utf16.inc' ;
;szString du '您好!我是示例程序。', 0
szString1 du '这个UNICODE中文字符定义的宏',0
.code
start:
invoke MessageBox,HWND_DESKTOP,invoke GetCommandLine,szString1,MB_OK+MB_ICONQUESTION
invoke ExitProcess,0
.end start