Author Topic: Ansii and unicode strings  (Read 6921 times)

ragdog

  • Member
  • ****
  • Posts: 609
Ansii and unicode strings
« on: September 23, 2012, 09:19:53 PM »
Hi

How i can use Ansii and Unicode string in my source for ansii and unicode build?

Quote
IFDEF __UNICODE__
WSTR            szProcessName,"Process name"   

ELSE
szProcessName    db "Process name",0

ENDIF

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Ansii and unicode strings
« Reply #1 on: September 23, 2012, 11:54:49 PM »
Well, how about reading the reference material in the MASM32 SDK, thats what its there for. Multiple systems including advanced macros the qword wrote. There are also examples of how to use these things.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

Mikl__

  • Member
  • *****
  • Posts: 1346
Re: Ansii and unicode strings
« Reply #2 on: December 16, 2012, 01:24:09 AM »
I used macro "du"
Code: [Select]
du macro string
local bslash
bslash = 0
irpc c,<string>
if bslash eq 0
if '&c' eq "/"
        bslash = 1
elseif '&c'gt 127
db ('&c'- 0B0h),4
else
dw '&c'
endif
else
           bslash = 0
           if '&c' eq "n"
           DW 0Dh,0Ah
           elseif '&c' eq "/"
           dw '/'
           elseif '&c' eq "r"
           dw 0Dh
           elseif '&c' eq "l"
           dw 0Ah
           elseif '&c' eq "s"
           dw 20h
           elseif '&c' eq "c"
           dw 3Bh
           elseif '&c' eq "t"
           dw 9
   endif
endif
endm
dw 0
endm
for example
Code: [Select]
wHello: du <Hello, world>