If would be useful it the assembler allowed this: dw "u16string", 0 dd "u32string",0
to replace this: dw 'u','1','6','s','t','r','i','n','g',0 dd 'u','3','2','s','t','r','i','n','g'.0
It can be done with the current version. It's one of the reasons why the OPTION RENAMEKEYWORD has been added. Sample for DW:
.386 .model flat option casemap:none
option renamekeyword:<dw>,dw_
dw macro lbl:LABEL, parms:VARARG local wstr wstr textequ <> for parm,<parms> ifidn <">,@SubStr(parm,1,1) % forc chr$, <@SubStr(parm,2,@SizeStr(parm)-2)> ifnb wstr wstr CatStr wstr,<,> endif wstr CatStr wstr,<'&chr$'> endm else ifnb wstr wstr CatStr wstr,<,> endif wstr CatStr wstr,<parm> endif endm lbl dw_ wstr endm
.data
utxt1 dw "Hello world",0
end
Log in to post a comment.
It can be done with the current version. It's one of the reasons why the OPTION RENAMEKEYWORD has been added. Sample for DW:
.386
.model flat
option casemap:none
option renamekeyword:<dw>,dw_
dw macro lbl:LABEL, parms:VARARG
local wstr
wstr textequ <>
for parm,<parms>
ifidn <">,@SubStr(parm,1,1)
% forc chr$, <@SubStr(parm,2,@SizeStr(parm)-2)>
ifnb wstr
wstr CatStr wstr,<,>
endif
wstr CatStr wstr,<'&chr$'>
endm
else
ifnb wstr
wstr CatStr wstr,<,>
endif
wstr CatStr wstr,<parm>
endif
endm
lbl dw_ wstr
endm
.data
utxt1 dw "Hello world",0
end