Menu

#17 constant unicode strings.

open
nobody
None
1
2011-03-04
2010-06-19
No

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

Discussion

  • japheth

    japheth - 2010-06-19

    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

     
  • japheth

    japheth - 2011-03-04
    • priority: 5 --> 1
     

Log in to post a comment.