Hello,

is there a better way to define an unicode string in asm than using:



szString1 dw "h", "e", "l", "l", "o", 0
szString2 db "h", 0, "e", 0, "l", 0, "l", 0, "o", 0, 0, 0


it's pretty annoying that way

Thanks Miracle
Posted on 2004-07-23 10:15:24 by miracle
NaN did a DUS macro, I think it is distributed with MASM32. GoAsm has integrated Unicode handling that is virtually transparent.
Posted on 2004-07-23 11:15:41 by donkey
blame eastern lang for the unicode hell :P
Posted on 2004-07-23 14:13:33 by wizzra
Posted on 2004-07-24 02:59:21 by Four-F
I got this macro, I dont remember where I got it from...



L MACRO Text
LOCAL buffer, Name
buffer textequ <>

FORC chr, <Text>
IFDIF <chr>, <">
buffer CatStr buffer, <">, <chr> , <",>
ENDIF
ENDM
buffer SUBSTR buffer, 1, @SizeStr(%buffer)-1

.data
align 4
Name dw buffer,0
.code
EXITM <OFFSET Name>
ENDM


I use it like:


invoke lstrcmpW, bstrName, L("Your Text")
Posted on 2004-07-24 03:03:58 by Jnrz